/* ========================================================== */
/* TUER.APP - MODULAR MATERIAL DESIGN 3 DESIGN SYSTEM         */
/* ========================================================== */

:root {
  /* ========================================================== */
  /* MATERIAL DESIGN 3 (M3) DESIGN TOKENS                       */
  /* ========================================================== */

  /* M3 Surface & Tonal Palette (Dark Theme) */
  --md-sys-color-surface: #0b1120;
  --md-sys-color-surface-dim: #070d18;
  --md-sys-color-surface-bright: #1e293b;
  --md-sys-color-surface-container-lowest: #050811;
  --md-sys-color-surface-container-low: #0f172a;
  --md-sys-color-surface-container: #131d31;
  --md-sys-color-surface-container-high: #182339;
  --md-sys-color-surface-container-highest: #1e2c47;
  --md-sys-color-on-surface: #f8fafc;
  --md-sys-color-on-surface-variant: #cbd5e1;
  --md-sys-color-outline: rgba(255, 255, 255, 0.12);
  --md-sys-color-outline-variant: rgba(255, 255, 255, 0.06);

  /* M3 Primary, Secondary, Tertiary & Accent Colors */
  --md-sys-color-primary: #f59e0b;
  --md-sys-color-on-primary: #1e1b18;
  --md-sys-color-primary-container: rgba(245, 158, 11, 0.18);
  --md-sys-color-on-primary-container: #fbbf24;

  --md-sys-color-secondary: #38bdf8;
  --md-sys-color-on-secondary: #082f49;
  --md-sys-color-secondary-container: rgba(56, 189, 248, 0.15);
  --md-sys-color-on-secondary-container: #7dd3fc;

  --md-sys-color-tertiary: #2dd4bf;
  --md-sys-color-on-tertiary: #042f2e;
  --md-sys-color-tertiary-container: rgba(45, 212, 191, 0.15);
  --md-sys-color-on-tertiary-container: #5eead4;

  --md-sys-color-error: #ef4444;
  --md-sys-color-on-error: #450a0a;
  --md-sys-color-error-container: rgba(239, 68, 68, 0.18);
  --md-sys-color-on-error-container: #fca5a5;

  /* M3 Shape Hierarchy */
  --md-sys-shape-none: 0px;
  --md-sys-shape-xs: 4px;
  --md-sys-shape-sm: 8px;
  --md-sys-shape-md: 12px;
  --md-sys-shape-lg: 16px;
  --md-sys-shape-xl: 28px;
  --md-sys-shape-full: 9999px;

  /* M3 Elevation (DP Shadows) */
  --md-sys-elevation-level0: none;
  --md-sys-elevation-level1: 0 1px 3px 1px rgba(0, 0, 0, 0.25), 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --md-sys-elevation-level2: 0 2px 6px 2px rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.35);
  --md-sys-elevation-level3: 0 4px 12px 3px rgba(0, 0, 0, 0.35), 0 1px 3px 0 rgba(0, 0, 0, 0.4);
  --md-sys-elevation-level4: 0 6px 16px 4px rgba(0, 0, 0, 0.4), 0 2px 4px 0 rgba(0, 0, 0, 0.45);
  --md-sys-elevation-level5: 0 8px 24px 6px rgba(0, 0, 0, 0.5), 0 4px 8px 0 rgba(0, 0, 0, 0.55);

  /* M3 Motion & Easing */
  --md-sys-motion-easing-standard: cubic-bezier(0.2, 0, 0, 1);
  --md-sys-motion-easing-emphasized: cubic-bezier(0.2, 0, 0, 1.2);
  --md-sys-motion-duration-short: 150ms;
  --md-sys-motion-duration-medium: 250ms;
  --md-sys-motion-duration-long: 400ms;

  /* M3 Typography Tokens */
  --md-sys-typescale-display-large: 800 2.25rem/1.2 'Plus Jakarta Sans', sans-serif;
  --md-sys-typescale-headline-medium: 700 1.5rem/1.3 'Plus Jakarta Sans', sans-serif;
  --md-sys-typescale-title-large: 700 1.25rem/1.35 'Plus Jakarta Sans', sans-serif;
  --md-sys-typescale-title-medium: 600 1rem/1.4 'Plus Jakarta Sans', sans-serif;
  --md-sys-typescale-body-large: 400 1rem/1.5 'Plus Jakarta Sans', sans-serif;
  --md-sys-typescale-body-medium: 400 0.875rem/1.5 'Plus Jakarta Sans', sans-serif;
  --md-sys-typescale-label-large: 600 0.875rem/1.2 'Plus Jakarta Sans', sans-serif;
  --md-sys-typescale-label-medium: 600 0.75rem/1.2 'Plus Jakarta Sans', sans-serif;
  --md-sys-typescale-code: 500 0.875rem/1.4 'JetBrains Mono', monospace;

  /* ========================================================== */
  /* LEGACY BRIDGE MAPPINGS (Ensures 100% zero-regression)     */
  /* ========================================================== */
  --bg-darkest: var(--md-sys-color-surface-dim);
  --bg-dark: var(--md-sys-color-surface);
  --bg-surface: var(--md-sys-color-surface-container);
  --bg-card: var(--md-sys-color-surface-container-high);
  --bg-card-hover: var(--md-sys-color-surface-container-highest);
  --bg-input: var(--md-sys-color-surface-container-lowest);
  --border-subtle: var(--md-sys-color-outline-variant);
  --border-focus: rgba(245, 158, 11, 0.5);
  
  --amber-primary: #d97706;
  --amber-light: var(--md-sys-color-primary);
  --amber-glow: var(--md-sys-color-primary-container);
  --gradient-amber: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
  --shadow-amber: 0 6px 20px rgba(245, 158, 11, 0.45);
  --blue-sky: var(--md-sys-color-secondary);
  --blue-dark: #0284c7;
  --blue-glow: var(--md-sys-color-secondary-container);
  --green-success: #10b981;
  --green-glow: var(--md-sys-color-tertiary-container);
  --red-danger: var(--md-sys-color-error);
  --red-glow: var(--md-sys-color-error-container);
  --purple-accent: #a855f7;

  --text-main: var(--md-sys-color-on-surface);
  --text-secondary: var(--md-sys-color-on-surface-variant);
  --text-muted: #8292a9;
  --text-dim: #54657e;

  --radius-sm: var(--md-sys-shape-sm);
  --radius-md: var(--md-sys-shape-md);
  --radius-lg: var(--md-sys-shape-lg);
  --radius-full: var(--md-sys-shape-full);
  --shadow-sm: var(--md-sys-elevation-level1);
  --shadow-md: var(--md-sys-elevation-level2);
  --shadow-lg: var(--md-sys-elevation-level3);
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

:root {
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}

html {
  overscroll-behavior-y: none;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
  overscroll-behavior-y: none;
}

body.is-native-android,
body.is-native-mobile {
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

html.modal-open,
body.modal-open {
  overflow: hidden !important;
  height: 100% !important;
  touch-action: none;
}

body.modal-open .mobile-bottom-nav,
body.modal-open .main-mobile-fab {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

#app, .app-root-container {
  width: 100%;
  min-height: 100vh;
}

/* Custom Sleek Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-darkest);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-card-hover);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--amber-primary);
}

/* Universal Utility Classes */
.hidden {
  display: none !important;
}

.text-muted { color: var(--text-muted); }
.text-danger { color: var(--red-danger); }
.text-strikethrough { text-decoration: line-through; }
.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

/* ========================================================== */
/* HEADER & TOP COMMAND BAR (MATERIAL DESIGN 3)              */
/* ========================================================== */
.app-header {
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 20px;
  box-shadow: var(--md-sys-elevation-level1);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-icon {
  background: linear-gradient(135deg, var(--md-sys-color-primary), #d97706);
  color: #0b1120;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  flex-shrink: 0;
  border-radius: var(--md-sys-shape-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.logo-icon i,
.logo-icon svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-title {
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
  line-height: 1.1;
}

.version-badge {
  font-size: 0.65rem;
  font-weight: 800;
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-primary);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 2px 6px;
  border-radius: var(--md-sys-shape-xs);
}

.app-subtitle {
  font-size: 0.74rem;
  color: var(--md-sys-color-on-surface-variant);
  font-weight: 500;
}

.header-center {
  flex: 1;
  max-width: 520px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-qr-scan-header {
  background: var(--md-sys-color-surface-container-high);
  border: 1px solid var(--md-sys-color-outline-variant);
  color: var(--amber-light, #f59e0b);
  padding: 8px 12px;
  border-radius: var(--md-sys-shape-full);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--md-sys-motion-duration-short) ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-qr-scan-header:hover {
  background: var(--md-sys-color-surface-container-highest);
  border-color: var(--amber-light, #f59e0b);
  box-shadow: 0 0 0 1px var(--amber-light, #f59e0b);
  transform: translateY(-1px);
}

.command-search-btn {
  width: 100%;
  background: var(--md-sys-color-surface-container-high);
  border: 1px solid var(--md-sys-color-outline-variant);
  color: var(--md-sys-color-on-surface-variant);
  padding: 10px 18px;
  border-radius: var(--md-sys-shape-full);
  font-size: 0.88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
  box-shadow: var(--md-sys-elevation-level1);
}

.command-search-btn:hover {
  background: var(--md-sys-color-surface-container-highest);
  border-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-surface);
  box-shadow: 0 0 0 1px var(--md-sys-color-primary);
}

.cmd-icon {
  width: 18px;
  height: 18px;
  color: var(--md-sys-color-primary);
  margin-right: 10px;
}

.cmd-btn-text {
  flex: 1;
  text-align: left;
}

.shortcut-key {
  background: var(--md-sys-color-surface-container-lowest);
  border: 1px solid var(--md-sys-color-outline);
  color: var(--md-sys-color-on-surface-variant);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--md-sys-shape-sm);
  font-family: 'JetBrains Mono', monospace;
}

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

.sync-badge {
  background: var(--md-sys-color-surface-container-high);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-full);
  padding: 5px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--md-sys-color-secondary);
}

.sync-dot {
  width: 8px;
  height: 8px;
  background-color: var(--md-sys-color-secondary);
  border-radius: var(--md-sys-shape-full);
  box-shadow: 0 0 8px var(--md-sys-color-secondary);
}


/* ========================================================== */
/* NAVIGATION BAR (MATERIAL DESIGN 3 PILL SEGMENTED BAR)     */
/* ========================================================== */
.nav-tabs-bar {
  background: var(--md-sys-color-surface-container-lowest);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  padding: 6px 16px;
}

.nav-tabs-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  align-items: center;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

.nav-tabs-container::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.nav-tab-btn { text-decoration: none !important; 
  background: transparent;
  border: none;
  color: var(--md-sys-color-on-surface-variant);
  padding: 7px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border-radius: var(--md-sys-shape-full);
  transition: all var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-standard);
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-tab-btn i,
.nav-tab-btn svg {
  width: 17px;
  height: 17px;
  min-width: 17px;
  min-height: 17px;
  flex-shrink: 0;
  transition: transform var(--md-sys-motion-duration-short) ease;
}

.nav-tab-btn:hover {
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
}

.nav-tab-btn.active {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.4);
}

.nav-tab-btn.active i,
.nav-tab-btn.active svg {
  transform: scale(1.06);
  color: var(--md-sys-color-primary);
}

.tab-badge {
  background: var(--md-sys-color-surface-container-highest);
  color: var(--md-sys-color-on-surface-variant);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--md-sys-shape-full);
  border: 1px solid var(--md-sys-color-outline-variant);
  transition: all var(--md-sys-motion-duration-short) ease;
}

/* Responsive Navbar auto-scaling for medium viewports */
@media (max-width: 1200px) and (min-width: 769px) {
  .nav-tabs-bar {
    padding: 4px 12px;
  }
  .nav-tabs-container {
    gap: 4px;
  }
  .nav-tab-btn { text-decoration: none !important; 
    padding: 6px 10px;
    font-size: 0.8rem;
    gap: 6px;
  }
  .nav-tab-btn i,
  .nav-tab-btn svg {
    width: 15px;
    height: 15px;
    min-width: 15px;
    min-height: 15px;
  }
  .tab-badge {
    padding: 1px 6px;
    font-size: 0.68rem;
  }
}

.nav-tab-btn.active .tab-badge {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  border-color: transparent;
}

.tab-badge.info {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  border-color: rgba(56, 189, 248, 0.3);
}

/* ========================================================== */
/* MAIN CONTAINER & VIEWPORT */
/* ========================================================== */
.app-container {
  flex: 1;
  padding: 20px;
  max-width: 100%;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin: 0 auto;
}

.tab-view {
  animation: fadeIn 0.2s ease-out;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.tab-view.hidden {
  display: none !important;
}

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

/* Header Action Bars */
.view-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.view-heading {
  font-size: 1.4rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.view-subheading {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 2px;
}

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

/* ========================================================== */
/* Responsive Visibility Utility Classes */
.show-mobile {
  display: none !important;
}

.btn-icon-kebab {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--md-sys-color-surface-container-high, #1e293b);
  border: 1px solid var(--md-sys-color-outline-variant, rgba(255, 255, 255, 0.12));
  border-radius: var(--md-sys-shape-md, 8px);
  color: var(--md-sys-color-on-surface, #ffffff);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.btn-icon-kebab:hover, .btn-icon-kebab:active {
  background: var(--md-sys-color-surface-container-highest, rgba(255, 255, 255, 0.16));
  border-color: var(--amber-light, #f59e0b);
}

/* Mobile Kebab Dropdown Menu */
.mobile-kebab-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-card, #1e293b);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
  border-radius: var(--md-sys-shape-md, 10px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  padding: 6px;
  min-width: 220px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: fadeIn 0.15s ease;
}

.kebab-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-primary, #ffffff);
  font-size: 0.84rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

.kebab-item:hover, .kebab-item:active {
  background: var(--bg-hover, rgba(255, 255, 255, 0.08));
}

.kebab-item.text-danger {
  color: var(--red-danger, #ef4444);
}

.kebab-item.text-danger:hover {
  background: rgba(239, 68, 68, 0.12);
}

/* Large Tablets and Laptops <= 992px */
@media (max-width: 992px) {
  .wiki-main-layout {
    grid-template-columns: 1fr;
  }
  .wiki-reader-pane {
    position: relative;
    max-height: none;
  }
  .order-hero-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .hero-meta-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Tablets & Mobile Devices <= 768px */
@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }
  .show-mobile {
    display: flex !important;
  }

  .app-header {
    padding: calc(8px + var(--sat)) 12px 8px 12px;
    height: auto;
    flex-wrap: wrap;
    gap: 8px;
  }

  .header-left .brand-subtitle,
  .brand-text .app-subtitle {
    display: none;
  }

  .header-center {
    order: 3;
    width: 100%;
    margin: 0;
  }

  .command-search-btn {
    width: 100%;
    max-width: 100%;
    justify-content: flex-start;
    padding: 8px 12px;
  }

  .command-search-btn .shortcut-key {
    display: none;
  }

  .header-right {
    margin-left: auto;
    gap: 8px;
  }

  .sync-text {
    display: none;
  }

  .sync-badge {
    padding: 6px;
  }

  .quick-btn-label {
    display: none;
  }

  .btn-quick-action {
    padding: 6px 10px;
  }

  .user-profile-widget {
    display: none !important;
  }

  .nav-tabs-bar {
    top: auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .nav-tabs-container {
    width: max-content;
    padding: 6px 12px;
  }

  .nav-tab-btn { text-decoration: none !important; 
    padding: 6px 12px;
    font-size: 0.8rem;
    white-space: nowrap;
  }

  .app-container {
    padding: 12px;
  }

  .view-header-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

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

  .search-input-wrapper {
    width: 100%;
  }

  .segmented-filter-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .segmented-control {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }

  .seg-btn {
    white-space: nowrap;
    padding: 6px 12px;
  }

  .subtabs-bar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }

  .subtab-btn {
    white-space: nowrap;
    padding: 8px 14px;
  }

  .step-filter-pills {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    padding-bottom: 4px;
  }

  .step-phase-pill {
    white-space: nowrap;
  }

  .wiki-category-chips {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    padding-bottom: 4px;
  }

  .filter-chip {
    white-space: nowrap;
  }

  .orders-grid,
  .customers-grid,
  .team-cards-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .modal-content {
    max-width: 96vw;
    padding: 16px;
    max-height: 90vh;
  }

  .status-pill-grid {
    grid-template-columns: 1fr 1fr;
  }

  .drawer-panel {
    width: 100vw;
    max-width: 100vw;
  }

  .hero-meta-grid {
    grid-template-columns: 1fr;
  }

  .detail-top-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .detail-action-buttons {
    justify-content: flex-end;
  }
}

/* Small Mobile Screens <= 480px */
@media (max-width: 480px) {
  .lock-card {
    padding: 20px 14px;
  }

  .lock-users-grid {
    grid-template-columns: 1fr;
  }

  .pin-key {
    padding: 10px 0;
    font-size: 1.15rem;
  }

  .status-pill-grid {
    grid-template-columns: 1fr 1fr;
  }

  .step-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .step-menu-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* ========================================================== */
/* MOBILE HAMBURGER, DRAWER & BOTTOM NAV STYLES */
/* ========================================================== */
.btn-hamburger {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
  flex-shrink: 0;
  margin-right: 6px;
}

.btn-hamburger:hover {
  background: var(--bg-card-hover);
  border-color: var(--amber-light);
  color: var(--amber-light);
}

.mobile-drawer-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(7, 13, 24, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1100;
  transition: opacity 0.3s ease;
}

.mobile-drawer-backdrop.hidden {
  display: none;
  opacity: 0;
}

.mobile-nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(320px, 86vw);
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-subtle);
  z-index: 1110;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: translateX(0);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}

.mobile-nav-drawer.hidden {
  transform: translateX(-100%);
  pointer-events: none;
}

.mobile-drawer-header {
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.drawer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.drawer-brand-text,
.drawer-brand > div:last-child {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.drawer-title {
  font-weight: 800;
  color: white;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.drawer-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-drawer-close,
.mobile-nav-drawer .btn-drawer-close {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  max-width: 32px;
  padding: 0;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.btn-drawer-close:hover,
.mobile-nav-drawer .btn-drawer-close:hover {
  color: white;
  border-color: var(--border-focus);
}

.drawer-user-card {
  padding: 16px 20px;
  background: var(--bg-darkest);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
}

.drawer-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--gradient-amber);
  color: #0b1120;
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-amber);
}

.drawer-user-name {
  font-weight: 700;
  color: white;
  font-size: 0.95rem;
}

.drawer-user-email {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.drawer-nav-section, .drawer-actions-section {
  padding: 16px 14px;
}

.drawer-section-heading {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  padding-left: 8px;
}

.drawer-nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.drawer-nav-item, .drawer-action-btn,
.mobile-nav-drawer a, .mobile-nav-drawer button:not(.btn-drawer-close) {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none !important;
}

.drawer-nav-item:hover, .drawer-action-btn:hover {
  background: var(--bg-card-hover);
  color: white;
}

.drawer-nav-item.active {
  background: var(--amber-glow);
  color: var(--amber-light);
  font-weight: 700;
  border-left: 3px solid var(--amber-light);
}

.drawer-nav-item svg, .drawer-action-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.drawer-actions-section {
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
}

/* Mobile Bottom Navigation Bar (Material Design 3) */
.mobile-bottom-nav,
.mobile-bottom-nav a,
.mobile-bottom-nav .mobile-nav-btn,
.mobile-bottom-nav .mobile-nav-btn span,
.mobile-bottom-nav * {
  text-decoration: none !important;
}

.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(68px + var(--sab));
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--md-sys-color-outline-variant);
  z-index: 1000;
  justify-content: space-around;
  align-items: flex-start;
  padding: 6px 8px calc(6px + var(--sab)) 8px;
  box-shadow: var(--md-sys-elevation-level2);
  box-sizing: border-box;
}

.mobile-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: transparent;
  border: none;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 4px;
  position: relative;
  text-decoration: none !important;
  border-radius: var(--md-sys-shape-md);
  transition: all var(--md-sys-motion-duration-short) ease;
}

.mobile-nav-btn i,
.mobile-nav-btn svg {
  width: 20px;
  height: 20px;
  transition: transform var(--md-sys-motion-duration-short) ease;
}

.mobile-nav-btn:hover {
  color: var(--md-sys-color-on-surface);
}

.mobile-nav-btn.active {
  color: var(--md-sys-color-primary);
  font-weight: 700;
}

.mobile-nav-btn.active i,
.mobile-nav-btn.active svg {
  transform: scale(1.1);
  color: var(--md-sys-color-primary);
}

.mobile-nav-btn .tab-badge {
  position: absolute;
  top: 3px;
  right: calc(50% - 18px);
  font-size: 0.62rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: var(--md-sys-shape-full);
}

/* Mobile Floating Action Button (M3 FAB) */
.main-mobile-fab {
  position: fixed;
  bottom: calc(82px + var(--sab));
  right: 18px;
  z-index: 990;
  background: var(--md-sys-color-primary) !important;
  color: var(--md-sys-color-on-primary) !important;
  font-weight: 800 !important;
  font-size: 0.88rem;
  border: none !important;
  border-radius: var(--md-sys-shape-lg);
  padding: 14px 20px;
  display: none;
  align-items: center;
  gap: 8px;
  box-shadow: var(--md-sys-elevation-level3), 0 4px 16px rgba(245, 158, 11, 0.4);
  cursor: pointer;
  transition: all var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-emphasized);
}

.main-mobile-fab:hover {
  transform: scale(1.05);
  box-shadow: var(--md-sys-elevation-level4), 0 6px 22px rgba(245, 158, 11, 0.5);
}

.main-mobile-fab:active {
  transform: scale(0.96);
}

.main-mobile-fab svg,
.main-mobile-fab i {
  width: 18px;
  height: 18px;
  color: #0b1120 !important;
  stroke: #0b1120 !important;
  stroke-width: 2.4px;
}

.main-mobile-fab span,
.main-mobile-fab .fab-label {
  color: #0b1120 !important;
  font-weight: 800 !important;
}


/* ========================================================== */
/* DESKTOP NAVIGATION RAIL & SIDEBAR LAYOUT (M3)             */
/* ========================================================== */
@media (min-width: 1024px) {
  .app-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
    overflow-x: clip;
  }

  .nav-tabs-bar {
    grid-column: 1;
    grid-row: 1 / -1;
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    max-height: 100vh;
    border-bottom: none;
    border-right: 1px solid var(--md-sys-color-outline-variant);
    background: var(--md-sys-color-surface-container-lowest);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
  }

  .nav-tabs-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    margin: 0;
  }

  .nav-tab-btn { text-decoration: none !important; 
    width: 100%;
    justify-content: flex-start;
    padding: 12px 18px;
    font-size: 0.92rem;
  }

  .nav-tab-btn .tab-badge {
    margin-left: auto;
  }

  .app-header {
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: 0;
    z-index: 90;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .app-container {
    grid-column: 2;
    grid-row: 2;
    max-width: 100%;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 28px 36px;
    margin: 0;
  }
}
/* Search Input Wrapper */
.search-input-wrapper {
  position: relative;
  min-width: 280px;
  display: flex;
  align-items: center;
}

.search-input-wrapper i,
.search-input-wrapper svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input-wrapper input {
  width: 100%;
  padding-left: 36px !important;
  padding-right: 14px;
  height: 38px;
  border-radius: var(--md-sys-shape-md);
  font-size: 0.88rem;
}

/* Segmented Filter Row (Material Design 3) */
.segmented-filter-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 14px;
  flex-wrap: wrap;
}

.segmented-control {
  display: inline-flex;
  background: var(--md-sys-color-surface-container);
  padding: 4px;
  border-radius: var(--md-sys-shape-full);
  border: 1px solid var(--md-sys-color-outline-variant);
  overflow-x: auto;
  max-width: 100%;
  align-items: center;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.segmented-control::-webkit-scrollbar {
  display: none;
}

.seg-btn {
  background: transparent;
  border: none;
  color: var(--md-sys-color-on-surface-variant);
  padding: 7px 18px;
  border-radius: var(--md-sys-shape-full);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
  white-space: nowrap;
}

.seg-btn:hover {
  color: var(--md-sys-color-on-surface);
  background: var(--md-sys-color-surface-container-high);
}

.seg-btn.active {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  font-weight: 700;
  box-shadow: var(--md-sys-elevation-level1);
}

.seg-btn.seg-danger.active {
  background: var(--md-sys-color-error-container);
  color: var(--md-sys-color-on-error-container);
}

.seg-btn.seg-success.active {
  background: var(--md-sys-color-tertiary-container);
  color: var(--md-sys-color-on-tertiary-container);
}

/* Edge-Fade Container for Scrollable Navigation Bars */
.scroll-fade-container {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  max-width: 100%;
}

.scroll-fade-container::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 48px;
  background: linear-gradient(to right, rgba(11, 17, 32, 0) 0%, rgba(11, 17, 32, 0.95) 100%);
  pointer-events: none;
  opacity: 0.9;
  z-index: 5;
}

.orders-subnav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.orders-subnav-row .scroll-fade-container {
  flex: 1;
  min-width: 0;
}

.orders-subnav-row .orders-subtabs-bar,
.orders-subnav-row .subtabs-bar,
.orders-subnav-row .tasks-subtabs-bar {
  margin-bottom: 0 !important;
}

.orders-subnav-row .view-display-toggles,
.orders-subnav-row .view-toggle-group {
  flex-shrink: 0;
  margin-left: 8px;
}

.view-display-toggles {
  display: flex;
  gap: 4px;
  background: var(--md-sys-color-surface-container);
  padding: 4px;
  border-radius: var(--md-sys-shape-full);
  border: 1px solid var(--md-sys-color-outline-variant);
}

.btn-icon-toggle {
  background: transparent;
  border: none;
  color: var(--md-sys-color-on-surface-variant);
  padding: 8px 10px;
  border-radius: var(--md-sys-shape-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--md-sys-motion-duration-short) ease;
}

.btn-icon-toggle i,
.btn-icon-toggle svg {
  width: 17px;
  height: 17px;
}

.btn-icon-toggle:hover {
  color: var(--md-sys-color-on-surface);
}

.btn-icon-toggle.active {
  background: var(--md-sys-color-surface-container-highest);
  color: var(--md-sys-color-primary);
  box-shadow: var(--md-sys-elevation-level1);
}

/* ========================================================== */
/* BUTTONS & FORMS (MATERIAL DESIGN 3)                       */
/* ========================================================== */
button {
  font-family: inherit;
}

.btn-primary {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  border: none;
  padding: 9px 20px;
  border-radius: var(--md-sys-shape-full);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--md-sys-elevation-level1);
  transition: all var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
}

.btn-primary:hover {
  box-shadow: var(--md-sys-elevation-level2), 0 4px 14px rgba(245, 158, 11, 0.35);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary i,
.btn-primary svg {
  width: 17px;
  height: 17px;
}

.btn-secondary {
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
  border: 1px solid var(--md-sys-color-outline-variant);
  padding: 9px 18px;
  border-radius: var(--md-sys-shape-full);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--md-sys-motion-duration-short) ease;
}

.btn-secondary:hover {
  background: var(--md-sys-color-surface-container-highest);
  border-color: var(--md-sys-color-outline);
}

.btn-secondary i,
.btn-secondary svg {
  width: 16px;
  height: 16px;
}

.btn-danger {
  background: var(--md-sys-color-error);
  color: #ffffff;
  border: none;
  padding: 9px 18px;
  border-radius: var(--md-sys-shape-full);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: var(--md-sys-elevation-level1);
  transition: all var(--md-sys-motion-duration-short) ease;
}

.btn-danger:hover {
  box-shadow: var(--md-sys-elevation-level2);
  transform: translateY(-1px);
}

.btn-danger-ghost {
  background: var(--md-sys-color-error-container);
  color: var(--md-sys-color-on-error-container);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 8px 14px;
  border-radius: var(--md-sys-shape-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--md-sys-motion-duration-short) ease;
}

.btn-danger-ghost:hover {
  background: var(--md-sys-color-error);
  color: #ffffff;
}

.btn-danger-ghost i,
.btn-danger-ghost svg {
  width: 16px;
  height: 16px;
}

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

input[type="text"], input[type="search"], input[type="password"], input[type="number"], input[type="email"], input[type="tel"], input[type="date"], select, textarea {
  width: 100%;
  background: var(--md-sys-color-surface-container-lowest);
  border: 1px solid var(--md-sys-color-outline-variant);
  color: var(--md-sys-color-on-surface);
  padding: 11px 14px;
  border-radius: var(--md-sys-shape-md);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--md-sys-motion-duration-short) ease, box-shadow var(--md-sys-motion-duration-short) ease;
}

input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 2px var(--md-sys-color-primary-container);
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--md-sys-color-on-surface-variant);
  margin-bottom: 6px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

/* ========================================================== */
/* ORDER CARDS & LIST */
/* ========================================================== */
.orders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
}


/* ========================================================== */
/* COMMAND PALETTE (CTRL + K) */
/* ========================================================== */
.command-palette-box {
  background: var(--bg-card);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  animation: fadeIn 0.15s ease-out;
}

.command-search-header {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  gap: 12px;
}

.palette-icon,
.command-search-header svg.palette-icon {
  width: 20px;
  height: 20px;
  color: var(--amber-light);
  flex-shrink: 0;
}

.command-search-header input {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  font-size: 1.05rem;
  color: #ffffff;
}

.command-search-header input:focus {
  box-shadow: none !important;
}

.esc-badge {
  background: var(--bg-darkest);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: 'JetBrains Mono', monospace;
}

.command-results {
  max-height: 360px;
  overflow-y: auto;
  padding: 8px;
}

.cmd-group-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 6px 12px;
}

.cmd-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.88rem;
  transition: all 0.1s ease;
}

.cmd-item i,
.cmd-item svg {
  width: 16px;
  height: 16px;
  color: var(--amber-light);
  flex-shrink: 0;
}

.cmd-item:hover, .cmd-item.selected {
  background: var(--bg-surface);
  color: #ffffff;
}

.command-footer {
  display: flex;
  gap: 16px;
  padding: 10px 18px;
  background: var(--bg-darkest);
  border-top: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.command-footer kbd {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: monospace;
}
/* ========================================================== */
/* DEDICATED ORDERS LIST ROW (TABLE-LIKE ALIGNED VIEW)        */
/* ========================================================== */
.orders-grid.list-mode {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.order-card.order-list-row {
  display: grid;
  grid-template-columns: 170px minmax(220px, 2fr) 150px 150px 170px 24px;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  border-radius: var(--md-sys-shape-md);
  margin-bottom: 0;
  box-shadow: none;
  border: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface-container);
  transition: all var(--md-sys-motion-duration-short) ease;
}

.order-card.order-list-row:hover {
  background: var(--md-sys-color-surface-container-high);
  border-color: var(--md-sys-color-primary);
  transform: translateX(3px);
  box-shadow: var(--md-sys-elevation-level1);
}

.ol-col-id {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

.ol-col-client {
  min-width: 0;
}

.ol-col-client .client-name-heading {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--md-sys-color-on-surface);
}

.ol-col-client .site-address-row {
  margin-bottom: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.76rem;
  color: var(--md-sys-color-on-surface-variant);
}

.ol-col-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.76rem;
  color: var(--md-sys-color-on-surface-variant);
  min-width: 0;
}

.ol-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ol-col-status {
  min-width: 0;
  display: flex;
  align-items: center;
}

.status-pill-ok {
  background: rgba(34, 197, 94, 0.12);
  color: var(--green-success);
  border: 1px solid rgba(34, 197, 94, 0.3);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--md-sys-shape-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.status-pill-progress {
  background: rgba(56, 189, 248, 0.12);
  color: var(--blue-sky);
  border: 1px solid rgba(56, 189, 248, 0.3);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--md-sys-shape-full);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.ol-col-progress {
  min-width: 0;
  width: 100%;
}

.ol-col-progress .progress-container {
  margin-top: 0;
  width: 100%;
}

.ol-col-action {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--md-sys-color-on-surface-variant);
}

.ol-chevron {
  width: 16px;
  height: 16px;
  transition: transform 0.15s ease;
}

.order-card.order-list-row:hover .ol-chevron {
  transform: translateX(2px);
  color: var(--md-sys-color-primary);
}

/* Medium Desktop / Tablet Landscape (1024px - 1280px) */
@media (max-width: 1280px) and (min-width: 901px) {
  .order-card.order-list-row {
    grid-template-columns: 150px minmax(180px, 1.8fr) 130px 130px 140px 20px;
    gap: 12px;
    padding: 10px 14px;
  }
}

/* Tablet Portrait (769px - 900px) */
@media (max-width: 900px) and (min-width: 601px) {
  .order-card.order-list-row {
    grid-template-columns: 140px 1.8fr 1.2fr;
    gap: 12px;
    padding: 12px 14px;
  }
  .ol-col-meta,
  .ol-col-action {
    display: none;
  }
}

/* Mobile (< 600px) */
@media (max-width: 600px) {
  .order-card.order-list-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px 14px;
  }
  .ol-col-id {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }
  .ol-col-meta,
  .ol-col-action {
    display: none;
  }
  .ol-col-progress {
    width: 100%;
  }
}

.order-card {
  background: var(--md-sys-color-surface-container-high);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-lg);
  padding: 20px;
  cursor: pointer;
  transition: all var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: var(--md-sys-elevation-level1);
  min-width: 0;
  overflow: hidden;
  overflow-wrap: break-word;
  word-break: break-word;
}

.order-card:hover {
  border-color: var(--md-sys-color-primary);
  transform: translateY(-2px);
  box-shadow: var(--md-sys-elevation-level2), 0 4px 16px rgba(0, 0, 0, 0.3);
}

.order-card.has-problem {
  border: 1px solid var(--md-sys-color-error);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.05), var(--md-sys-color-surface-container-high));
}

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

.order-num-tag {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--md-sys-color-primary);
  font-size: 0.95rem;
}

.type-pill {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--md-sys-shape-full);
  text-transform: uppercase;
}

.pill-eigenbau { background: var(--md-sys-color-primary-container); color: var(--md-sys-color-on-primary-container); border: 1px solid rgba(245, 158, 11, 0.3); }
.pill-zukauf { background: rgba(100, 116, 139, 0.15); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.3); }
.pill-mischform { background: rgba(245, 158, 11, 0.2); color: #fde68a; border: 1px solid var(--amber-light); }
.pill-fenster { background: var(--md-sys-color-tertiary-container); color: var(--md-sys-color-tertiary); border: 1px solid rgba(45, 212, 191, 0.4); }
.pill-kueche { background: rgba(99, 102, 241, 0.15); color: #a5b4fc; border: 1px solid #6366f1; }
.pill-sonder { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid #a855f7; }

.client-name-heading {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
  overflow-wrap: break-word;
  word-break: break-word;
}

.site-address-row {
  font-size: 0.84rem;
  color: var(--md-sys-color-on-surface-variant);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  overflow-wrap: break-word;
  word-break: break-word;
}

.site-address-row i,
.site-address-row svg {
  width: 15px;
  height: 15px;
  color: var(--md-sys-color-primary);
}

.order-desc-text {
  font-size: 0.86rem;
  color: var(--md-sys-color-on-surface-variant);
  line-height: 1.45;
  margin-bottom: 16px;
  flex: 1;
  overflow-wrap: break-word;
  word-break: break-word;
}

.order-elem-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--md-sys-color-secondary);
  background: var(--md-sys-color-secondary-container);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 3px 10px;
  border-radius: var(--md-sys-shape-full);
  margin-bottom: 12px;
  font-weight: 600;
  width: fit-content;
}

.problem-callout {
  background: var(--md-sys-color-error-container);
  border: 1px solid var(--md-sys-color-error);
  color: var(--md-sys-color-on-error-container);
  padding: 8px 14px;
  border-radius: var(--md-sys-shape-md);
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.progress-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
}

.progress-track-bar {
  flex: 1;
  height: 8px;
  background: var(--md-sys-color-surface-container);
  border-radius: var(--md-sys-shape-full);
  overflow: hidden;
}

.progress-fill-bar {
  height: 100%;
  background: linear-gradient(90deg, #d97706, var(--md-sys-color-primary));
  border-radius: var(--md-sys-shape-full);
  transition: width 0.3s ease;
}

.progress-fill-bar.done {
  background: var(--md-sys-color-tertiary);
}

.progress-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
  white-space: nowrap;
}

/* ========================================================== */
/* ORDER DETAIL VIEW (HUB & CLEAN TABS)                      */
/* ========================================================== */
.detail-top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.btn-back {
  background: var(--md-sys-color-surface-container-high);
  border: 1px solid var(--md-sys-color-outline-variant);
  color: var(--md-sys-color-on-surface);
  padding: 8px 16px;
  border-radius: var(--md-sys-shape-full);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--md-sys-motion-duration-short) ease;
}

.btn-back:hover {
  background: var(--md-sys-color-surface-container-highest);
}


/* Detail Subtabs Bar & Unified M3 Pill Subnav */
.subtabs-bar,
.orders-subtabs-bar {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  background: var(--md-sys-color-surface-container);
  padding: 4px;
  border-radius: var(--md-sys-shape-full);
  border: 1px solid var(--md-sys-color-outline-variant);
  overflow-x: auto;
  max-width: 100%;
  box-sizing: border-box;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.order-detail-subnav {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  background: var(--md-sys-color-surface-container);
  padding: 4px;
  border-radius: var(--md-sys-shape-full);
  border: 1px solid var(--md-sys-color-outline-variant);
  overflow-x: auto;
  max-width: 100%;
  box-sizing: border-box;
  scrollbar-width: none;
  -ms-overflow-style: none;
  margin-bottom: 20px;
}

.subtabs-bar::-webkit-scrollbar,
.order-detail-subnav::-webkit-scrollbar,
.orders-subtabs-bar::-webkit-scrollbar {
  display: none;
}

.subtab-btn,
.orders-subtab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--md-sys-shape-full);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--md-sys-motion-duration-short) ease;
}

.subtab-btn i,
.subtab-btn svg,
.orders-subtab-btn svg {
  width: 16px;
  height: 16px;
  color: inherit;
  transition: color var(--md-sys-motion-duration-short) ease;
}

.subtab-btn:hover,
.orders-subtab-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.subtab-btn.active,
.orders-subtab-btn.active {
  background: var(--amber-light);
  color: #0b1120;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.subtab-btn.active i,
.subtab-btn.active svg,
.orders-subtab-btn.active svg {
  color: #0b1120;
}

.subtab-count {
  background: var(--md-sys-color-surface-container-highest);
  color: var(--md-sys-color-on-surface-variant);
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: var(--md-sys-shape-full);
  font-weight: 800;
}

.subtab-btn.active .subtab-count,
.orders-subtab-btn.active .subtab-count {
  background: rgba(11, 17, 32, 0.25);
  color: #0b1120;
}

.subtab-count.danger {
  background: var(--md-sys-color-error);
  color: white;
}

.subtab-content.hidden {
  display: none;
}

/* ========================================================== */
/* STEPS & TASK ENGINE (MATERIAL DESIGN 3 - TEXT FOCUSED)     */
/* ========================================================== */
.steps-toolbar,
.step-phase-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-add-step-desktop {
  margin-left: auto;
  flex-shrink: 0;
  display: inline-flex;
}

.step-filter-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  max-width: 100%;
  padding-bottom: 4px;
}

.step-phase-pill {
  background: var(--bg-surface);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.step-phase-pill:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.step-phase-pill.active {
  background: var(--amber-light);
  color: #0b1120;
  border-color: var(--amber-light);
  font-weight: 700;
}

.step-phase-pill.pill-danger.active {
  background: var(--red-danger);
  color: #ffffff;
  border-color: var(--red-danger);
}

.steps-clean-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Step Card (Clean Text-Focused) */
.step-card {
  background: var(--md-sys-color-surface-container-high);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-lg);
  padding: 18px 20px;
  transition: all var(--md-sys-motion-duration-short) ease;
  position: relative;
  box-shadow: var(--md-sys-elevation-level1);
}

.step-card:hover {
  border-color: var(--md-sys-color-primary);
  box-shadow: var(--md-sys-elevation-level2);
}

.step-card.step-problem {
  border: 1px solid var(--md-sys-color-error);
  background: linear-gradient(to right, rgba(239, 68, 68, 0.08), var(--md-sys-color-surface-container-high));
}

.step-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.step-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.step-role-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--md-sys-shape-full);
  text-transform: uppercase;
}

.role-werkstatt { background: var(--md-sys-color-primary-container); color: var(--md-sys-color-primary); border: 1px solid rgba(245, 158, 11, 0.3); }
.role-montage { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-secondary); border: 1px solid rgba(56, 189, 248, 0.3); }

.step-title-text {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
}

.step-menu-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-step-icon {
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  color: var(--md-sys-color-on-surface-variant);
  width: 32px;
  height: 32px;
  border-radius: var(--md-sys-shape-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--md-sys-motion-duration-short) ease;
}

.btn-step-icon:hover {
  color: var(--md-sys-color-on-surface);
  background: var(--md-sys-color-surface-container-highest);
}

/* Dynamic Wiki Match Box (M3 Style) */
.dynamic-wiki-box {
  margin-top: 12px;
  margin-bottom: 14px;
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.wiki-match-info {
  font-size: 0.82rem;
  color: var(--md-sys-color-secondary);
  font-weight: 600;
}

.wiki-match-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.wiki-tag-pill {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 4px 12px;
  border-radius: var(--md-sys-shape-full);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  transition: all var(--md-sys-motion-duration-short) ease;
}

.wiki-tag-pill:hover {
  background: var(--md-sys-color-secondary);
  color: var(--md-sys-color-on-secondary);
}

/* 4 Status Segmented Buttons (Material Design 3 - Pill Container) */
.status-pill-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.st-pill {
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  color: var(--md-sys-color-on-surface-variant);
  padding: 9px 12px;
  border-radius: var(--md-sys-shape-full);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: all var(--md-sys-motion-duration-short) var(--md-sys-motion-easing-standard);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.st-pill:hover {
  background: var(--md-sys-color-surface-container-highest);
  color: var(--md-sys-color-on-surface);
}

.st-pill.st-offen.active {
  background: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-primary);
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: var(--md-sys-elevation-level1);
}

.st-pill.st-arbeit.active {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-secondary);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: var(--md-sys-elevation-level1);
}

.st-pill.st-done.active {
  background: var(--md-sys-color-tertiary-container);
  color: var(--md-sys-color-tertiary);
  border-color: rgba(45, 212, 191, 0.4);
  box-shadow: var(--md-sys-elevation-level1);
}

.st-pill.st-problem.active {
  background: var(--md-sys-color-error-container);
  color: var(--md-sys-color-error);
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: var(--md-sys-elevation-level1);
}

/* ========================================================== */
/* ELEMENTS / AUFMAß MATRIX TABLE */
/* ========================================================== */
.elements-tab-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.elements-table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

.modern-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

.modern-table th {
  background: var(--bg-darkest);
  color: var(--text-muted);
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.modern-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  vertical-align: middle;
}

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

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

.dim-code {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--amber-light);
  background: var(--amber-glow);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(245, 158, 11, 0.2);
  white-space: nowrap;
}

.din-badge {
  font-weight: 700;
  font-size: 0.78rem;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.din-left { background: var(--blue-glow); color: var(--blue-sky); }
.din-right { background: var(--green-glow); color: var(--green-success); }

/* Mobile Card List for Bemaßung */
.elements-mobile-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.elem-mobile-card {
  background: var(--bg-card, #1e293b);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: var(--md-sys-shape-md, 10px);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}

.elem-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.elem-pos-badge {
  background: var(--amber-glow, rgba(245, 158, 11, 0.15));
  color: var(--amber-light, #f59e0b);
  border: 1px solid rgba(245, 158, 11, 0.3);
  font-weight: 800;
  font-size: 0.76rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono, monospace);
}

.elem-room-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: #ffffff;
  flex: 1;
}

.elem-dim-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: var(--bg-darkest, #0c1322);
  padding: 6px 10px;
  border-radius: 6px;
}

.dim-label {
  color: var(--text-secondary, #94a3b8);
  font-size: 0.76rem;
}

.dim-code-pill {
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  color: var(--amber-light, #f59e0b);
  font-size: 0.82rem;
  white-space: nowrap;
}

.elem-meta-row {
  font-size: 0.78rem;
  color: var(--text-secondary, #cbd5e1);
  display: flex;
  gap: 6px;
}

.elem-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
}

.btn-xs {
  padding: 4px 8px;
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 4px;
}

/* ========================================================== */
/* WORKSHOP TASKS VIEW & KANBAN */
/* ========================================================== */
.tasks-enhanced-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.15s ease;
}

.task-item-card:hover {
  border-color: var(--border-focus);
}

.task-item-card.completed {
  opacity: 0.6;
}

.task-item-card.completed .task-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-checkbox-custom {
  width: 22px;
  height: 22px;
  accent-color: var(--amber-light);
  cursor: pointer;
}

.task-main-info {
  flex: 1;
}

.task-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.task-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.task-prio-badge {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.prio-dringend { background: var(--red-danger); color: white; }
.prio-normal { background: var(--bg-surface); color: var(--text-muted); }
.prio-niedrig { background: rgba(148, 163, 184, 0.1); color: var(--text-dim); }

.task-sub-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

/* Kanban Board */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  overflow-x: auto;
  min-height: 480px;
  align-items: start;
}

@media (max-width: 1024px) {
  .kanban-board {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .kanban-board {
    grid-template-columns: 1fr;
  }
}

.kanban-column {
  background: #0c1322;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--md-sys-shape-lg, 14px);
  padding: 14px;
  display: flex;
  flex-direction: column;
  min-height: 240px;
}

.kanban-col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  color: #f8fafc;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.col-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-offen, .dot-grey { background: #94a3b8; }
.dot-arbeit, .dot-blue { background: #38bdf8; box-shadow: 0 0 8px rgba(56, 189, 248, 0.4); }
.dot-warten, .dot-amber { background: #f59e0b; box-shadow: 0 0 8px rgba(245, 158, 11, 0.4); }
.dot-erledigt, .dot-green { background: #22c55e; box-shadow: 0 0 8px rgba(34, 197, 94, 0.4); }

.col-count {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.5);
  color: #cbd5e1;
  padding: 2px 8px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.kanban-col-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kanban-column.drag-target-active {
  border-color: var(--amber-light, #f59e0b) !important;
  background: rgba(245, 158, 11, 0.06) !important;
  box-shadow: inset 0 0 16px rgba(245, 158, 11, 0.15);
}

.kanban-card {
  background: #151e2d;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--md-sys-shape-md, 10px);
  padding: 14px;
  cursor: grab;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  position: relative;
  user-select: none;
}

.kanban-card:active {
  cursor: grabbing;
}

.kanban-card.is-dragging {
  opacity: 0.4;
  border-style: dashed;
  border-color: var(--amber-light, #f59e0b);
  transform: scale(0.97);
}

.kanban-card:hover {
  background: #1a2538;
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.kanban-card.card-completed {
  opacity: 0.75;
}
.kanban-card.card-completed:hover {
  opacity: 1;
}

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

.kanban-card-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.35;
  word-break: break-word;
}

.kanban-card-desc {
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.45;
  margin: 0 0 14px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.78rem;
}

.kanban-worker {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.worker-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.avatar-amber { background: #f59e0b; color: #0b1120; }
.avatar-blue { background: #3b82f6; color: #ffffff; }
.avatar-purple { background: #8b5cf6; color: #ffffff; }
.avatar-emerald { background: #10b981; color: #0b1120; }
.avatar-cyan { background: #06b6d4; color: #0b1120; }

.worker-name {
  color: #cbd5e1;
  font-weight: 500;
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kanban-due {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #94a3b8;
  font-size: 0.76rem;
  flex-shrink: 0;
  margin-left: auto;
}

.task-prio-badge.prio-dringend {
  background: #ef4444;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.task-prio-badge.prio-normal {
  background: #334155;
  color: #94a3b8;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.task-prio-badge.prio-niedrig {
  background: #1e293b;
  color: #64748b;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ========================================================== */
/* FIRMEN-WIKI SYSTEM (RICH KNOWLEDGE BASE) */
/* ========================================================== */
.wiki-search-container {
  margin-bottom: 18px;
}

.wiki-search-box-large {
  position: relative;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
}

.wiki-search-box-large input {
  width: 100%;
  padding: 12px 14px 12px 42px !important;
  font-size: 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-card);
}

.wiki-search-box-large .search-icon,
.wiki-search-box-large i,
.wiki-search-box-large svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--amber-light);
  pointer-events: none;
}

.btn-clear-search {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
}

.wiki-category-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.filter-chip {
  background: var(--bg-surface);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.filter-chip:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.filter-chip.active {
  background: var(--amber-primary);
  color: #ffffff;
  border-color: var(--amber-primary);
}


.wiki-article-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.wiki-article-card:hover {
  border-color: var(--amber-light);
  background: var(--bg-card-hover);
}

.wiki-article-card.selected {
  border-color: var(--amber-light);
  background: var(--bg-surface);
  box-shadow: 0 0 0 1px var(--amber-light);
}

.wiki-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.wiki-cat-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--blue-sky);
  background: var(--blue-glow);
  padding: 2px 6px;
  border-radius: 4px;
}

.wiki-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
}

.wiki-card-snippet {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}


.wiki-article-header {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 16px;
  margin-bottom: 20px;
}

.wiki-article-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 8px;
}

.wiki-article-meta {
  display: flex;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
  align-items: center;
  flex-wrap: wrap;
}

/* Markdown & Technical formatting for Wiki */
.wiki-article-body {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

.wiki-article-body h3 {
  color: #ffffff;
  font-size: 1.15rem;
  margin-top: 18px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 4px;
}

.wiki-article-body ul {
  padding-left: 20px;
  margin-bottom: 14px;
}

.wiki-article-body li {
  margin-bottom: 6px;
}

.wiki-article-body strong {
  color: #ffffff;
}

/* Parameter Tables in Wiki */
.wiki-table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 0.85rem;
}

.wiki-table th, .wiki-table td {
  border: 1px solid var(--border-subtle);
  padding: 8px 12px;
  text-align: left;
}

.wiki-table th {
  background: var(--bg-darkest);
  color: var(--amber-light);
}

/* Wiki Alert Callout Boxes */
.callout-warning {
  background: var(--red-glow);
  border-left: 4px solid var(--red-danger);
  padding: 12px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 14px 0;
  color: #fca5a5;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.callout-tip {
  background: var(--amber-glow);
  border-left: 4px solid var(--amber-light);
  padding: 12px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 14px 0;
  color: #fef08a;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.callout-note {
  background: var(--blue-glow);
  border-left: 4px solid var(--blue-sky);
  padding: 12px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 14px 0;
  color: #bae6fd;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.callout-warning i, .callout-warning svg,
.callout-tip i, .callout-tip svg,
.callout-note i, .callout-note svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ========================================================== */
/* IN-CONTEXT SLIDE-OVER WIKI DRAWER */
/* ========================================================== */
.drawer-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(7, 13, 24, 0.7);
  backdrop-filter: blur(8px);
  z-index: 1050;
  display: flex;
  justify-content: flex-end;
}

.drawer-overlay.hidden {
  display: none;
}

.drawer-panel {
  background: var(--bg-card);
  width: 100%;
  max-width: 580px;
  height: 100%;
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

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

.drawer-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--amber-light);
  display: flex;
  align-items: center;
  gap: 4px;
  text-transform: uppercase;
}

.drawer-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
}

.drawer-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.drawer-search-bar {
  position: relative;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
}

.drawer-search-bar input {
  width: 100%;
  padding-left: 36px !important;
  height: 38px;
}

.drawer-search-bar i,
.drawer-search-bar svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.drawer-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  gap: 10px;
}


/* ========================================================== */
/* LIGHTBOX & TOASTS */
/* ========================================================== */
.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  text-align: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: var(--radius-md);
  border: 2px solid var(--amber-light);
  box-shadow: var(--shadow-lg);
}

.lightbox-close-btn {
  position: absolute;
  top: -16px;
  right: -16px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  border: 1px solid var(--border-subtle);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.4rem;
}

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInUp 0.2s ease-out;
}

.toast i,
.toast svg {
  width: 18px;
  height: 18px;
}

.toast.toast-success { border-left: 4px solid var(--green-success); }
.toast.toast-danger { border-left: 4px solid var(--red-danger); }
.toast.toast-info { border-left: 4px solid var(--blue-sky); }

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

/* ========================================================== */
/* NOTIFICATION CENTER WIDGET & DROPDOWN                      */
/* ========================================================== */
.notification-bell-widget {
  position: relative;
}

.btn-notification-bell {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all var(--md-sys-motion-duration-short) ease;
}

.btn-notification-bell:hover {
  background: var(--bg-card-hover);
  color: var(--amber-light);
  border-color: var(--border-focus);
}

.btn-notification-bell i,
.btn-notification-bell svg {
  pointer-events: none;
}

.notif-badge-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--red-danger);
  color: white;
  font-size: 0.65rem;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  line-height: 1;
  padding: 0 4px;
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-darkest);
  display: flex !important;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
}

@keyframes pulse-badge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); box-shadow: 0 0 10px rgba(239, 68, 68, 0.6); }
}

.notification-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 410px;
  max-width: calc(100vw - 20px);
  background: rgba(15, 23, 42, 0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08);
  z-index: 500;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: notif-pop-in 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.notification-dropdown-menu.hidden {
  display: none !important;
}

@keyframes notif-pop-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.notif-dropdown-header {
  padding: 12px 14px 10px 14px;
  background: rgba(30, 41, 59, 0.65);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.notif-header-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.notif-dropdown-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  gap: 7px;
}

.btn-notif-mark-all {
  background: transparent;
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: var(--amber-light);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-notif-mark-all:hover {
  background: var(--amber-glow);
  border-color: var(--amber-light);
}

.notif-subnav-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-darkest);
  padding: 3px;
  border-radius: var(--radius-full);
  width: 100%;
}

.notif-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  white-space: nowrap;
}

.notif-tab-btn.active {
  background: var(--bg-card);
  color: white;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.notif-dropdown-list {
  max-height: 380px;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notif-dropdown-list::-webkit-scrollbar {
  width: 6px;
}
.notif-dropdown-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.notif-dropdown-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.notif-dropdown-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
  transform: translateX(2px);
}

.notif-dropdown-card.unread {
  background: rgba(30, 41, 59, 0.85);
  border-left: 3px solid var(--amber-primary);
}

.notif-dropdown-card.priority-urgent {
  border-left: 3px solid var(--red-danger) !important;
}

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

.notif-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.notif-type-tag {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.notif-type-tag i,
.notif-type-tag svg {
  width: 11px;
  height: 11px;
}

.notif-type-tag.urgent { background: rgba(239, 68, 68, 0.2); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.4); }
.notif-type-tag.problem { background: rgba(245, 158, 11, 0.2); color: var(--amber-light); border: 1px solid rgba(245, 158, 11, 0.4); }
.notif-type-tag.montage { background: rgba(168, 85, 247, 0.2); color: #d8b4fe; border: 1px solid rgba(168, 85, 247, 0.4); }
.notif-type-tag.order { background: rgba(56, 189, 248, 0.2); color: #7dd3fc; border: 1px solid rgba(56, 189, 248, 0.4); }
.notif-type-tag.announcement { background: rgba(245, 158, 11, 0.2); color: #fde68a; border: 1px solid rgba(245, 158, 11, 0.4); }
.notif-type-tag.team { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.4); }
.notif-type-tag.info { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.4); }

.notif-time {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.notif-dismiss-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.15s ease;
}

.notif-dismiss-btn:hover {
  opacity: 1;
  color: var(--red-danger);
  background: rgba(239, 68, 68, 0.15);
}

.notif-dismiss-btn svg {
  width: 12px;
  height: 12px;
}

.notif-card-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: white;
  margin-bottom: 3px;
}

.notif-card-msg {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.35;
  margin-bottom: 8px;
}

.notif-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notif-author {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.notif-author-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-darkest);
  color: var(--amber-light);
  font-size: 0.6rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
}

.notif-unread-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber-light);
  box-shadow: 0 0 6px var(--amber-light);
}

.notif-empty-state {
  text-align: center;
  padding: 36px 20px;
  color: var(--text-muted);
}

.notif-empty-icon {
  width: 42px;
  height: 42px;
  margin: 0 auto 10px auto;
  color: var(--green-success);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 185, 129, 0.1);
  border-radius: 50%;
}

.notif-empty-icon svg {
  width: 24px;
  height: 24px;
}

.notif-empty-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: white;
  margin-bottom: 4px;
}

.notif-empty-desc {
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ========================================================== */
/* DASHBOARD BULLETIN BOARD (INFOTAFEL)                       */
/* ========================================================== */
.dash-bulletin-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.bulletin-board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.bulletin-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
  position: relative;
}

.bulletin-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.bulletin-card.pinned {
  border-color: rgba(245, 158, 11, 0.5);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.07), var(--bg-surface));
}

.bulletin-card.dringend {
  border-left: 4px solid var(--red-danger);
}

.bulletin-card.wichtig {
  border-left: 4px solid var(--amber-light);
}

.bulletin-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bulletin-meta-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.bulletin-meta-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bulletin-pin-badge {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--amber-light);
  background: var(--amber-glow);
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 2px 6px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.bulletin-pin-badge svg {
  width: 10px;
  height: 10px;
}

.bulletin-cat-pill {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--bg-darkest);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.bulletin-prio-pill {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.bulletin-prio-pill.urgent {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.bulletin-prio-pill.important {
  background: rgba(245, 158, 11, 0.2);
  color: var(--amber-light);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.bulletin-date {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.bulletin-delete-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 3px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.bulletin-delete-btn:hover {
  color: var(--red-danger);
  background: rgba(239, 68, 68, 0.15);
}

.bulletin-delete-btn svg {
  width: 13px;
  height: 13px;
}

.bulletin-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: white;
  line-height: 1.3;
}

.bulletin-card-content {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.bulletin-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.bulletin-author {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.bulletin-empty-card {
  text-align: center;
  padding: 32px 16px;
  background: var(--bg-surface);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  grid-column: 1 / -1;
}

.bulletin-empty-icon {
  width: 32px;
  height: 32px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.bulletin-empty-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: white;
  margin-bottom: 4px;
}

.bulletin-empty-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
}


/* ========================================================== */
/* CUSTOMERS VIEW & MATERIAL DESIGN 3 CARDS                  */
/* ========================================================== */
.customers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  width: 100%;
}

.customers-grid.list-mode {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Material Design 3 Elevated Customer Card */
.customer-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all var(--md-sys-motion-duration-short) cubic-bezier(0.2, 0, 0, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  min-width: 0;
  overflow: hidden;
  overflow-wrap: break-word;
  word-break: break-word;
}

.customer-card:hover {
  background: #19243a;
  border-color: var(--border-focus);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(245, 158, 11, 0.2);
}

/* MD3 Customer Card Header */
.customer-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

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

.cust-avatar-badge {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  font-weight: 800;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.cust-num-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--amber-light);
  background: var(--amber-glow);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.cust-orders-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--blue-sky);
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 3px 9px;
  border-radius: var(--radius-full);
}

/* Body & Typography */
.cust-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.cust-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 4px 0;
  line-height: 1.35;
}

.cust-contact-person {
  font-size: 0.84rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.cust-details-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.cust-info-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  word-break: break-word;
}

.cust-info-item i,
.cust-info-item svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--amber-light);
}

.cust-info-item a {
  color: var(--blue-sky);
  text-decoration: none;
  transition: color 0.15s ease;
}

.cust-info-item a:hover {
  color: white;
  text-decoration: underline;
}

.cust-notes-box {
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  margin-top: 4px;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.4;
}

.cust-card-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* ========================================================== */
/* CUSTOMER LIST MODE (COMPACT ROW)                          */
/* ========================================================== */
.customer-card.customer-list-row {
  display: grid;
  grid-template-columns: auto minmax(180px, 1.2fr) minmax(220px, 1.5fr) auto;
  align-items: center;
  padding: 10px 16px;
  gap: 16px;
  border-radius: var(--radius-md);
}

.cl-col-avatar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cl-meta-stacked {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cl-col-name .cust-title {
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.cl-col-name .cust-contact-person {
  font-size: 0.78rem;
  margin-bottom: 0;
}

.cl-col-contact {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.8rem;
}

.cust-info-inline {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.cl-col-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .customer-card.customer-list-row {
    grid-template-columns: 1fr auto;
    gap: 10px;
  }
  .cl-col-contact {
    grid-column: 1 / -1;
  }
  .cl-col-actions {
    grid-column: 2;
    grid-row: 1;
  }
}


/* ========================================================== */
/* MODERN RESPONSIVE ORDER DETAIL TOPBAR (M3 SPEC)           */
/* ========================================================== */
.order-detail-topbar {
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-lg);
  padding: 14px 18px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--md-sys-elevation-level1);
  width: 100%;
  box-sizing: border-box;
}

.order-topbar-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
}

.order-nav-identifiers {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-back-link {
  background: var(--md-sys-color-surface-container-high);
  border: 1px solid var(--md-sys-color-outline-variant);
  color: var(--md-sys-color-on-surface);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 6px 12px;
  border-radius: var(--md-sys-shape-full);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--md-sys-motion-duration-short) ease;
  white-space: nowrap;
}

.btn-back-link:hover {
  background: var(--md-sys-color-surface-container-highest);
  color: #ffffff;
  border-color: var(--md-sys-color-primary);
  transform: translateX(-2px);
}

.btn-back-link svg {
  width: 15px;
  height: 15px;
}

.order-identity-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-info-badge {
  background: var(--md-sys-color-primary-container);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: var(--md-sys-color-primary);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--md-sys-shape-full);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-info-badge:hover {
  background: var(--amber-primary);
  color: #0b1120;
  border-color: var(--amber-light);
}

.btn-info-badge svg {
  width: 13px;
  height: 13px;
}

.order-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.order-topbar-actions .btn-secondary {
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  gap: 6px;
  white-space: nowrap;
}

.order-topbar-actions .btn-rekl-action {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.order-topbar-actions .btn-rekl-action:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #ffffff;
}

.order-topbar-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.order-topbar-title-row.clickable-order-info {
  cursor: pointer;
  border-radius: var(--md-sys-shape-sm);
  padding: 4px 6px;
  margin: -4px -6px;
  transition: background var(--md-sys-motion-duration-short) ease;
}

.order-topbar-title-row.clickable-order-info:hover {
  background: rgba(251, 191, 36, 0.08);
}

.det-client-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--md-sys-color-on-surface);
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.25;
  word-break: break-word;
}

@media (max-width: 768px) {
  .order-detail-topbar {
    padding: 12px 14px;
    gap: 8px;
  }
  .order-topbar-nav-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
  }
  .order-nav-identifiers {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
    min-width: 0;
  }
  .order-topbar-actions {
    overflow-x: auto;
    flex-wrap: nowrap;
    width: 100%;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .order-topbar-actions::-webkit-scrollbar {
    display: none;
  }
  .order-topbar-actions .btn-secondary {
    flex-shrink: 0;
    padding: 6px 10px;
    font-size: 0.78rem;
  }
  .det-client-title {
    font-size: 1.15rem;
  }
  .order-detail-subnav {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 4px;
    margin-bottom: 20px;
  }
  .order-detail-subnav::-webkit-scrollbar {
    display: none;
  }
  .order-detail-subnav .subtab-btn {
    flex-shrink: 0;
    padding: 6px 12px;
    font-size: 0.78rem;
  }
  .step-phase-filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .btn-add-step-desktop {
    display: none !important;
  }
  .step-filter-pills {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    width: 100%;
  }
  .step-filter-pills::-webkit-scrollbar {
    display: none;
  }
  .status-pill-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
  }
}

.order-detail-content-area {
  padding-bottom: 90px;
}

/* ========================================================== */
/* ORDER ATTACHMENTS & DRAWINGS STYLES */
/* ========================================================== */
.attachment-dropzone {
  border: 2px dashed var(--border-subtle);
  background: rgba(30, 41, 59, 0.4);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.attachment-dropzone:hover,
.attachment-dropzone.dragover {
  border-color: var(--amber-light);
  background: rgba(251, 191, 36, 0.06);
  transform: translateY(-1px);
}

.attachment-dropzone .dropzone-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(251, 191, 36, 0.12);
  color: var(--amber-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
}

.attachment-dropzone .dropzone-icon svg {
  width: 22px;
  height: 22px;
}

.attachment-dropzone .dropzone-text {
  font-size: 0.92rem;
  color: var(--text-main);
}

.attachment-dropzone .dropzone-browse {
  color: var(--amber-light);
  text-decoration: underline;
  font-weight: 700;
}

.attachment-dropzone .dropzone-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.attachments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.attachment-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  position: relative;
}

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

.attachment-preview-box {
  width: 100%;
  height: 180px;
  background: #0b1120;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.attachment-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.attachment-preview-box:hover img {
  transform: scale(1.04);
}

.attachment-pdf-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(15, 23, 42, 0.9));
  color: var(--red-danger);
}

.attachment-pdf-preview svg {
  width: 48px;
  height: 48px;
}

.attachment-type-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.attachment-card-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.attachment-file-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attachment-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.attachment-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.attachment-card-actions button,
.attachment-card-actions a {
  flex: 1;
  font-size: 0.76rem;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}

/* ========================================================== */
/* DECOUPLED WIKI FULL-SCREEN & CARDS STYLES */
/* ========================================================== */
.wiki-sub-page {
  animation: fadeIn 0.2s ease;
}

.wiki-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 16px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.wiki-reader-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.wiki-reader-actions {
  display: flex;
  gap: 8px;
}

.wiki-full-reader-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  box-shadow: var(--shadow-md);
  max-width: 960px;
  width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
}

@media (max-width: 1023px) {
  .btn-hamburger {
    display: inline-flex;
  }

  /* Absorb top status bar safe area into dark blurred header */
  .app-header {
    padding-top: calc(10px + var(--sat)) !important;
  }

  /* Branding completely hidden from mobile top header (only shown in hamburger drawer) */
  .app-header .brand {
    display: none !important;
  }

  .nav-tabs-bar {
    display: none !important;
  }

  .mobile-bottom-nav {
    display: flex;
  }

  .main-mobile-fab {
    display: inline-flex;
  }

  /* Mobile Notification Dropdown: stay within screen margins */
  .notification-dropdown-menu {
    position: fixed !important;
    top: 64px !important;
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    max-width: calc(100vw - 24px) !important;
  }

  /* Hide redundant static top action buttons replaced by the FAB on any tab */
  .view-header-bar .btn-primary,
  .view-header-bar .header-action-group .btn-primary,
  .btn-add-step-desktop,
  #btn-new-order,
  #btn-new-task,
  #btn-new-wiki,
  #btn-new-customer,
  #btn-add-step-to-order,
  #btn-add-element,
  .steps-action-group,
  .quick-create-dropdown,
  .list-view-toggle {
    display: none !important;
  }

  /* Remove ugly scrollbar overlap on rounded pill controls */
  .segmented-control,
  .step-filter-pills,
  .wiki-category-chips {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }

  .segmented-control::-webkit-scrollbar,
  .step-filter-pills::-webkit-scrollbar,
  .wiki-category-chips::-webkit-scrollbar {
    display: none !important;
  }

  /* Orders & Tasks Subnav Layout on Tablet & Mobile: View Toggles placed neatly below tabs */
  .orders-subnav-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 20px;
  }

  .orders-subnav-row .scroll-fade-container {
    width: 100%;
  }

  .orders-subnav-row .view-display-toggles,
  .orders-subnav-row .view-toggle-group {
    align-self: flex-start;
    margin-left: 0;
  }

  /* Ample bottom padding so FAB & bottom nav bar NEVER obscure cards, tables or buttons */
  .app-container {
    padding: 12px 14px 160px 14px;
  }

  .tab-view,
  .subtab-content,
  .orders-grid,
  .steps-clean-list,
  .elements-table-wrapper,
  .customer-info-hub,
  .photos-gallery-grid,
  .tasks-enhanced-list,
  .kanban-board,
  .wiki-cards-grid,
  .wiki-full-reader-card,
  .customers-grid,
  .settings-tab-layout {
    padding-bottom: 80px;
  }

  .view-header-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .header-action-group {
    width: 100%;
    flex-direction: column;
  }

  .header-action-group .search-input-wrapper {
    width: 100%;
  }

  .steps-toolbar {
    margin-bottom: 12px;
  }

  .order-detail-topbar {
    padding: 12px 14px;
    gap: 8px;
  }

  .order-topbar-nav-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
  }

  .order-topbar-actions {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .det-client-title {
    font-size: 1.15rem;
  }

  .wiki-full-reader-card {
    padding: 18px 16px 80px 16px;
  }

  .subtabs-bar {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 6px;
  }

  /* Settings Mobile Layout */
  .settings-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .settings-card {
    padding: 16px;
  }

  .settings-card-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .settings-header-actions {
    margin-left: 0;
    width: 100%;
    flex-direction: column;
    gap: 8px;
  }

  .settings-header-actions .btn-primary,
  .settings-header-actions .btn-secondary {
    width: 100%;
    justify-content: center;
  }

  .template-add-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .template-role-btn-group {
    width: 100%;
    display: flex;
    gap: 8px;
  }

  .template-role-select {
    flex: 1;
    width: auto;
  }

  .btn-add-step-submit {
    flex: 1;
    justify-content: center;
  }

  .team-cards-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .tag-add-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .tag-add-bar button {
    width: 100%;
    justify-content: center;
  }
}


/* ========================================================== */
/* NOTIFICATION CENTER (HEADER BELL & REALTIME ALERTS) */
/* ========================================================== */
.notification-bell-widget {
  position: relative;
}

.btn-notification-bell {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.btn-notification-bell:hover {
  background: var(--bg-card);
  border-color: var(--amber-light);
  color: var(--amber-light);
}

.notif-badge-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--red-danger);
  color: white;
  font-size: 0.65rem;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  line-height: 1;
  padding: 0 4px;
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-darkest);
  display: flex !important;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
}

@keyframes pulse-badge {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); box-shadow: 0 0 10px rgba(239, 68, 68, 0.6); }
}

.notification-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 380px;
  max-width: 90vw;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: fadeIn 0.15s ease-out;
}

.notif-dropdown-header {
  padding: 12px 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notif-dropdown-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: white;
  display: flex;
  align-items: center;
  gap: 8px;
}

.notif-dropdown-list {
  max-height: 380px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.15s ease;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.notif-item:hover {
  background: rgba(245, 158, 11, 0.05);
}

.notif-item.is-problem {
  border-left: 3px solid var(--red-danger);
  background: rgba(239, 68, 68, 0.04);
}

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

.notif-item-icon.problem {
  background: var(--red-glow);
  color: var(--red-danger);
}

.notif-item-icon.done {
  background: rgba(16, 185, 129, 0.15);
  color: var(--green-success);
}

.notif-item-content {
  flex: 1;
  min-width: 0;
}

.notif-item-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: white;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-item-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.35;
  margin-bottom: 4px;
}

.notif-item-time {
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* ========================================================== */
/* DASHBOARD COCKPIT (WERKSTATT LEITSTAND) */
/* ========================================================== */
.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.kpi-card {
  background: var(--md-sys-color-surface-container-high);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-lg);
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all var(--md-sys-motion-duration-short) ease;
  position: relative;
  overflow: hidden;
  box-shadow: var(--md-sys-elevation-level1);
}

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

.kpi-card.kpi-problem {
  background: var(--md-sys-color-error-container);
  border-color: var(--md-sys-color-error);
}

.kpi-card.kpi-problem .kpi-value {
  color: var(--md-sys-color-error);
}

.kpi-card.kpi-problem .kpi-label {
  color: var(--md-sys-color-on-error-container);
}

.kpi-icon-box {
  width: 48px;
  height: 48px;
  border-radius: var(--md-sys-shape-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.kpi-card.kpi-problem .kpi-icon-box { background: rgba(239, 68, 68, 0.25); color: var(--md-sys-color-error); }
.kpi-card.kpi-montage .kpi-icon-box { background: var(--md-sys-color-secondary-container); color: var(--md-sys-color-secondary); }
.kpi-card.kpi-done .kpi-icon-box { background: var(--md-sys-color-tertiary-container); color: var(--md-sys-color-tertiary); }
.kpi-card.kpi-werkstatt .kpi-icon-box { background: var(--md-sys-color-primary-container); color: var(--md-sys-color-primary); }

.kpi-value {
  font-size: 1.8rem;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  color: white;
  line-height: 1;
  margin-bottom: 4px;
}

.kpi-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.dashboard-main-columns {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

@media (max-width: 1024px) {
  .dashboard-main-columns {
    grid-template-columns: 1fr;
  }
}

.dash-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
}

.dash-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.dash-panel-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dash-problem-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dash-problem-card {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), var(--bg-surface));
  border: 1px solid var(--red-danger);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dash-problem-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.dash-problem-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dash-problem-order {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: #fca5a5;
  font-size: 0.85rem;
}

.dash-problem-note {
  font-size: 0.86rem;
  color: #fef2f2;
  font-weight: 600;
}

.dash-problem-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.activity-stream {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

.activity-stream::before {
  content: '';
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 17px;
  width: 2px;
  background: var(--border-subtle);
}

.activity-stream-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  position: relative;
  z-index: 1;
}

.activity-dot {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 2px solid var(--amber-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--amber-light);
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 800;
}

.activity-dot.done {
  border-color: var(--green-success);
  color: var(--green-success);
  background: rgba(16, 185, 129, 0.1);
}

.activity-dot.problem {
  border-color: var(--red-danger);
  color: var(--red-danger);
  background: var(--red-glow);
}

.activity-body {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.activity-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: white;
  margin-bottom: 2px;
}

.activity-meta {
  font-size: 0.76rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

.dashboard-bottom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.quick-action-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.dash-qa-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.dash-qa-btn:hover {
  background: var(--bg-card);
  border-color: var(--amber-light);
  color: var(--amber-light);
  transform: translateY(-2px);
}

/* Role Badges */
.user-role-badge,
.role-badge-generic {
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}


/* Reklamation Highlight Styles */
.reklamation-pill {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.25), rgba(220, 38, 38, 0.4));
  color: #fecaca;
  border: 1px solid #ef4444;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  animation: pulse-badge 2s infinite;
}

.reklamation-card-item {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), var(--bg-surface));
  border: 1.5px solid var(--red-danger);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}

.reklamation-card-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: var(--red-danger);
}

.reklamation-header-banner {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Archived Order Styles */
.order-card.is-archived {
  opacity: 0.75;
  border-color: rgba(255, 255, 255, 0.05);
  background: var(--bg-darkest);
}

.order-archived-tag {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}


/* Orders Subnav spacing */
.orders-subnav-row, .order-controls-bar {
  margin-bottom: 24px !important;
}

/* Calculator Tools Styles */
.calc-view-container {
  padding-bottom: 90px;
}

.calc-layout-grid {
  display: grid;
  grid-template-columns: minmax(300px, 360px) 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 900px) {
  .calc-layout-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.calc-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

@media (max-width: 600px) {
  .calc-cards-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.calc-two-col-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 768px) {
  .calc-two-col-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

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

@media (max-width: 680px) {
  .calc-three-col-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

.calc-card-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
}

@media (max-width: 600px) {
  .calc-card-box {
    padding: 14px;
  }
}

.tool-pane {
  animation: fadeIn 0.15s ease-in-out;
}
/* ========================================================== */
/* SETTINGS VIEW */
/* ========================================================== */
/* ========================================================== */
/* SETTINGS VIEW */
/* ========================================================== */
/* ========================================================== */
/* SETTINGS SUB-NAVIGATION BAR (UNIFIED M3 PILL CONTAINER)   */
/* ========================================================== */
.settings-subnav-bar {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  background: var(--md-sys-color-surface-container);
  padding: 4px;
  border-radius: var(--md-sys-shape-full);
  border: 1px solid var(--md-sys-color-outline-variant);
  overflow-x: auto;
  max-width: 100%;
  box-sizing: border-box;
  scrollbar-width: none;
}

.settings-subnav-bar::-webkit-scrollbar {
  display: none;
}

.settings-subnav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--md-sys-shape-full);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.settings-subnav-btn svg {
  width: 16px;
  height: 16px;
  color: inherit;
  transition: color 0.15s ease;
}

.settings-subnav-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.settings-subnav-btn.active {
  background: var(--amber-light);
  color: #0b1120;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.settings-subnav-btn.active svg {
  color: #0b1120;
}

.settings-subtab-pane {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.settings-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.settings-card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 14px;
}

.settings-header-titles {
  flex: 1;
  min-width: 0;
}

.settings-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.set-icon,
.settings-card-header svg.set-icon {
  width: 24px;
  height: 24px;
  color: var(--amber-light);
  flex-shrink: 0;
  margin-top: 2px;
}

.settings-card-header h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 4px;
}

.settings-card-header p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.settings-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.template-steps-preview {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  background: var(--bg-darkest);
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  margin-bottom: 12px;
}

.template-step-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  transition: all 0.15s ease;
}

.template-step-row:hover {
  background: var(--bg-card-hover);
  border-color: rgba(245, 158, 11, 0.3);
}

.template-step-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.template-add-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.template-step-input {
  flex: 1;
  min-width: 180px;
}

.template-role-btn-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.template-role-select {
  width: 120px;
}

.btn-add-step-submit {
  padding: 8px 14px;
  font-weight: 700;
  white-space: nowrap;
}

.tag-add-bar {
  display: flex;
  gap: 8px;
  align-items: center;
}

.tag-input-field {
  flex: 1;
  min-width: 180px;
}

.tags-cloud-box {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
  background: var(--bg-darkest);
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  max-height: 240px;
  overflow-y: auto;
}

.tag-badge-pill {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.tag-badge-pill:hover {
  border-color: var(--amber-light);
  color: #ffffff;
}

.tag-badge-pill button {
  background: none;
  border: none;
  color: var(--red-danger);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  transition: transform 0.15s ease;
}

.tag-badge-pill button:hover {
  transform: scale(1.2);
}

.settings-actions-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.file-upload-label {
  cursor: pointer;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}


/* ========================================================== */
/* NOTIFICATION SETTINGS TOGGLE STYLES                        */
/* ========================================================== */
.notif-toggle-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notif-toggle-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.notif-toggle-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
}

.notif-toggle-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.notif-toggle-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: white;
}

.notif-toggle-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.modern-toggle {
  appearance: none;
  -webkit-appearance: none;
  width: 44px;
  height: 24px;
  background: var(--bg-darkest);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.modern-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.modern-toggle:checked {
  background: var(--amber-primary);
  border-color: var(--amber-light);
}

.modern-toggle:checked::after {
  transform: translateX(20px);
  background: #0b1120;
}


/* ========================================================== */
/* USER PROFILE & FAST TEAM SWITCHER */
/* ========================================================== */
.user-profile-widget {
  position: relative;
}

.btn-user-profile {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 4px 10px 4px 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-user-profile:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--amber-light), var(--amber-primary));
  color: #0b1120;
  font-weight: 800;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.user-meta-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.user-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
}

.user-role-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 3px;
  text-transform: uppercase;
  margin-top: 2px;
}

.user-chevron,
.btn-user-profile svg.user-chevron {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
}

/* Role Badges */
.role-badge-meister { background: var(--amber-glow); color: var(--amber-light); border: 1px solid rgba(245, 158, 11, 0.3); }
.role-badge-buero { background: rgba(129, 140, 248, 0.18); color: #a5b4fc; border: 1px solid rgba(129, 140, 248, 0.35); }
.role-badge-werkstatt, .role-badge-mitarbeiter { background: var(--blue-glow); color: var(--blue-sky); border: 1px solid rgba(56, 189, 248, 0.3); }
.role-badge-montage { background: var(--green-glow); color: var(--green-success); border: 1px solid rgba(16, 185, 129, 0.3); }
.role-badge-azubi, .role-badge-lehrling { background: rgba(148, 163, 184, 0.18); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.3); }
.role-badge-aushilfe { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.3); }

/* User Profile Dropdown */
.user-profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 290px;
  padding: 12px;
  z-index: 200;
}

.dropdown-user-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
}

.dropdown-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--amber-light), var(--amber-primary));
  color: #0b1120;
  font-weight: 800;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropdown-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffffff;
}

.dropdown-role-label {
  font-size: 0.72rem;
  color: var(--amber-light);
  font-weight: 600;
}

.dropdown-email {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 8px 0;
}

.dropdown-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 6px;
  padding: 0 4px;
}

.quick-users-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 180px;
  overflow-y: auto;
}

.quick-user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.quick-user-item:hover {
  background: var(--bg-card-hover);
  border-color: rgba(245, 158, 11, 0.3);
}

.quick-user-item.active {
  border-color: var(--amber-light);
  background: rgba(245, 158, 11, 0.1);
}

.quick-user-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quick-u-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #334155;
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropdown-item {
  width: 100%;
  background: none;
  border: none;
  color: var(--text-main);
  padding: 8px 10px;
  text-align: left;
  font-size: 0.84rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease;
}

.dropdown-item i,
.dropdown-item svg {
  width: 15px;
  height: 15px;
  color: var(--amber-light);
}

.dropdown-item:hover {
  background: var(--bg-surface);
}

.dropdown-item.text-danger {
  color: var(--red-danger);
}

.dropdown-item.text-danger i,
.dropdown-item.text-danger svg {
  color: var(--red-danger);
}

/* Team Management in Settings */
.team-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.team-user-card,
.team-member-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.2s ease;
  position: relative;
}

.team-user-card:hover,
.team-member-card:hover {
  border-color: rgba(245, 158, 11, 0.45);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.team-user-card.current-active-user,
.team-member-card.team-card-current {
  border-color: rgba(16, 185, 129, 0.5);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.06) 0%, var(--bg-surface) 100%);
}

.team-user-top,
.team-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.team-user-info-rows {
  background: var(--bg-darkest);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.team-user-info-rows > div {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-user-info-rows svg,
.team-user-info-rows i {
  width: 13px;
  height: 13px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.team-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}


/* ========================================================== */
/* PRINTABLE QR-PASS ID CARD */
/* ========================================================== */
.qr-pass-card {
  background: #0f172a;
  border: 2px solid var(--amber-primary);
  border-radius: var(--radius-lg);
  padding: 20px;
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  margin: 0 auto;
}

.qr-pass-header {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(245, 158, 11, 0.3);
  padding-bottom: 10px;
  margin-bottom: 14px;
}

.qr-code-canvas-box {
  width: 150px;
  height: 150px;
  background: #ffffff;
  padding: 8px;
  border-radius: 8px;
  margin: 0 auto 12px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-code-canvas-box img,
.qr-code-canvas-box canvas {
  width: 100% !important;
  height: 100% !important;
}

.qr-user-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 2px;
}

.qr-token-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 4px;
}

.qr-token-code {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--amber-light);
  letter-spacing: 2px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px dashed var(--amber-light);
  padding: 4px 10px;
  border-radius: 4px;
  display: inline-block;
  margin-top: 2px;
}

.qr-pass-footer {
  font-size: 0.68rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border-subtle);
  padding-top: 8px;
  margin-top: 12px;
}

/* ========================================================== */
/* SCHLAGWÖRTER & WIKI-TAXONOMIE STYLES                       */
/* ========================================================== */
.tag-add-bar {
  display: flex;
  gap: 8px;
  align-items: center;
}

.tag-input-field {
  flex: 1;
  min-width: 180px;
}

.tags-cloud-box {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
  background: var(--bg-darkest);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  max-height: 280px;
  overflow-y: auto;
}

.tag-badge-pill {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  padding: 4px 8px 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  user-select: none;
}

.tag-badge-pill:hover {
  border-color: rgba(245, 158, 11, 0.4);
  color: #ffffff;
  background: rgba(30, 41, 59, 0.9);
}

.tag-delete-btn {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--red-light);
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
  margin-left: 2px;
}

.tag-delete-btn:hover {
  background: var(--red-danger);
  color: white;
  border-color: var(--red-danger);
  transform: scale(1.15);
}

@media (max-width: 600px) {
  .tag-add-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
}

/* ========================================================== */
/* INVITATION SYSTEM & ONBOARDING STYLES */
/* ========================================================== */
.invitations-section {
  background: var(--bg-darkest);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 20px;
}

.invitations-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.pending-invites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.invite-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
}

.invite-card.expired {
  opacity: 0.6;
  border-color: rgba(239, 68, 68, 0.3);
}

.invite-card.used {
  opacity: 0.7;
  border-color: rgba(16, 185, 129, 0.3);
}

.invite-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.invite-code-pill {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--amber-light);
  background: rgba(245, 158, 11, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px dashed var(--amber-light);
}

.invite-status-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.status-badge-active {
  background: rgba(245, 158, 11, 0.2);
  color: var(--amber-light);
  border: 1px solid var(--amber-primary);
}

.status-badge-expired {
  background: rgba(239, 68, 68, 0.2);
  color: var(--red-danger);
}

.status-badge-used {
  background: rgba(16, 185, 129, 0.2);
  color: var(--green-success);
}

.invite-card-body {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.invite-actions-row {
  display: flex;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

/* Printable / Presentable Invitation Badge */
.invite-badge-card {
  background: linear-gradient(145deg, #0f172a, #090e1a);
  border: 2px solid var(--amber-primary);
  border-radius: var(--radius-lg);
  padding: 20px;
  color: #ffffff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  margin: 0 auto;
}

.invite-expiry-pill {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid var(--amber-light);
  color: var(--amber-light);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.invite-expiry-pill svg {
  width: 14px;
  height: 14px;
}

/* Onboarding Welcome Banner */
.onboarding-welcome-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(6, 78, 59, 0.4));
  border: 1px solid var(--green-success);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
}


/* Role Management Grid */
.roles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.role-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s ease;
}

.role-card:hover {
  border-color: var(--amber-light);
  transform: translateY(-2px);
}

.role-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.role-level-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-darkest);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.role-desc-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.role-members-list {
  font-size: 0.76rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}


/* Settings Pane Backgrounds & Structure */
.settings-card,
.settings-pane,
.settings-pane-content,
.settings-section-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
}

.roles-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  width: 100%;
}
/* ========================================================== */
/* MODALS & DIALOGS (MATERIAL DESIGN 3)                      */
/* ========================================================== */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: rgba(5, 8, 17, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  z-index: 3500;
}

.modal.hidden {
  display: none !important;
}

.modal-content {
  background: var(--md-sys-color-surface-container-high);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-xl);
  max-width: 560px;
  width: 100%;
  padding: 24px;
  box-shadow: var(--md-sys-elevation-level4);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  transition: transform var(--md-sys-motion-duration-medium) var(--md-sys-motion-easing-emphasized);
}

@media (max-width: 640px) {
  .modal {
    padding: 8px 8px env(safe-area-inset-bottom, 8px) 8px;
    align-items: flex-start;
    padding-top: 12px;
  }
  .modal-content {
    max-height: calc(100dvh - 24px - env(safe-area-inset-bottom, 0px));
    padding: 16px;
    border-radius: var(--radius-lg, 16px);
  }
}

.modal-large {
  max-width: 760px;
}

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

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-header h3 i,
.modal-header h3 svg {
  width: 22px;
  height: 22px;
}

.modal-close {
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  color: var(--md-sys-color-on-surface-variant);
  width: 34px;
  height: 34px;
  border-radius: var(--md-sys-shape-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all var(--md-sys-motion-duration-short) ease;
}

.modal-close:hover {
  background: var(--md-sys-color-surface-container-highest);
  color: var(--md-sys-color-on-surface);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 0;
  border-top: 1px solid var(--md-sys-color-outline-variant);
  padding: 16px 24px 20px 24px;
  background: transparent;
}

/* Editor helpers */
.editor-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  flex-wrap: wrap;
  gap: 6px;
}

.markdown-toolbar {
  display: flex;
  gap: 4px;
}

.md-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 0.74rem;
  cursor: pointer;
}

.md-btn:hover {
  background: var(--bg-card-hover);
  color: var(--amber-light);
}

.tag-suggestions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.tag-sug-pill {
  font-size: 0.72rem;
  background: var(--bg-surface);
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
}

.tag-sug-pill:hover {
  color: var(--amber-light);
  background: var(--bg-card-hover);
}


/* ========================================================== */
/* IN-CONTEXT SLIDE-OVER WIKI DRAWER */
/* ========================================================== */
.drawer-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(7, 13, 24, 0.7);
  backdrop-filter: blur(8px);
  z-index: 1050;
  display: flex;
  justify-content: flex-end;
}

.drawer-overlay.hidden {
  display: none;
}

.drawer-panel {
  background: var(--bg-card);
  width: 100%;
  max-width: 580px;
  height: 100%;
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

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

.drawer-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--amber-light);
  display: flex;
  align-items: center;
  gap: 4px;
  text-transform: uppercase;
}

.drawer-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
}

.drawer-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.drawer-search-bar {
  position: relative;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
}

.drawer-search-bar input {
  width: 100%;
  padding-left: 36px !important;
  height: 38px;
}

.drawer-search-bar i,
.drawer-search-bar svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.drawer-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  gap: 10px;
}


/* ========================================================== */
/* ========================================================== */
/* SECURE FULLSCREEN ENTERPRISE LOGIN SCREEN */
/* ========================================================== */
.lock-screen-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at 50% 20%, rgba(30, 41, 59, 0.95), #060a12 90%);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow-y: auto;
}

.lock-card {
  width: 100%;
  max-width: 460px;
  background: var(--bg-card);
  border: 1px solid var(--border-focus);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  box-shadow: var(--shadow-xl), 0 0 50px rgba(245, 158, 11, 0.1);
  animation: fadeIn 0.3s ease-out;
  overflow: visible;
}

.lock-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.lock-logo {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--amber-light), var(--amber-primary));
  color: #0b1120;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

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

.lock-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
}

.lock-version {
  font-size: 0.78rem;
  color: var(--amber-light);
  font-weight: 600;
}

.lock-security-banner {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: #6ee7b7;
  margin-bottom: 20px;
}

.lock-security-banner svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--green-success);
}


.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon svg {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.input-with-icon input {
  padding-left: 38px !important;
  width: 100%;
}

.btn-lg {
  padding: 12px 18px;
  font-size: 0.95rem;
  font-weight: 700;
}

.lock-footer-help {
  margin-top: 16px;
  font-size: 0.75rem;
  color: var(--text-dim);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.lock-footer-help svg {
  width: 13px;
  height: 13px;
}



/* ========================================================== */
/* DEDICATED HIGH-DENSITY PRINT STYLES */
/* ========================================================== */
.printable-order-container {
  display: none;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 6mm 8mm 6mm 8mm;
  }

  *, *::before, *::after {
    box-sizing: border-box !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    color: #0f172a !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
    font-size: 8pt !important;
    line-height: 1.25 !important;
    height: auto !important;
    min-height: 0 !important;
  }

  /* Hide app shell and all dialogs */
  body > *:not(.printable-order-container) {
    display: none !important;
  }

  /* Show dedicated printable sheet */
  .printable-order-container {
    display: block !important;
    position: static !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #0f172a !important;
    background: #ffffff !important;
  }

  .print-sheet-root {
    width: 100%;
    margin: 0;
    padding: 0;
  }

  /* 1. Compact Header Block */
  .print-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    border: 1.5px solid #0f172a;
    border-radius: 4px;
    padding: 6px 10px;
    margin-bottom: 6px;
    background: #f8fafc;
    gap: 12px;
  }

  .header-zone-brand {
    flex: 1.1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  .header-company-name {
    font-size: 8.5pt;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  .header-doc-title {
    font-size: 7pt;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: 0.05em;
    margin-top: 1px;
  }

  .header-order-num {
    font-size: 14pt;
    font-weight: 900;
    color: #0f172a;
    letter-spacing: -0.02em;
    margin: 2px 0;
    font-variant-numeric: tabular-nums;
  }

  .header-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 2px;
  }

  .h-badge {
    font-size: 6.5pt;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 3px;
    background: #e2e8f0;
    color: #1e293b;
    border: 1px solid #cbd5e1;
  }

  .h-badge.highlight {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
    font-weight: 700;
  }

  .header-zone-meta {
    flex: 1.3;
    border-left: 1px solid #cbd5e1;
    padding-left: 10px;
    display: flex;
    align-items: center;
  }

  .meta-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 7.5pt;
    line-height: 1.3;
  }

  .meta-table td {
    padding: 1px 0;
    vertical-align: top;
  }

  .m-label {
    width: 75px;
    color: #64748b;
    font-weight: 600;
  }

  .m-val {
    color: #0f172a;
  }

  .date-highlight {
    color: #b45309 !important;
    font-weight: 800;
  }

  .header-zone-qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-left: 1px solid #cbd5e1;
    padding-left: 10px;
    flex-shrink: 0;
  }

  .print-qr-code-img {
    width: 54px !important;
    height: 54px !important;
    display: block;
  }

  .qr-sub-text {
    font-size: 5.5pt;
    color: #64748b;
    text-align: center;
    margin-top: 2px;
    text-transform: uppercase;
    font-weight: 700;
  }

  /* Description Banner */
  .print-order-description {
    font-size: 7.5pt;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 3px;
    padding: 3px 6px;
    margin-bottom: 6px;
    color: #78350f;
  }

  /* Section Title Bar */
  .print-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0f172a;
    color: #ffffff;
    font-size: 8pt;
    font-weight: 800;
    padding: 3px 6px;
    border-radius: 3px 3px 0 0;
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }

  /* 2. Elements Table */
  .print-sheet-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 7pt;
    font-variant-numeric: tabular-nums;
    margin-bottom: 4px;
  }

  .print-sheet-table th,
  .print-sheet-table td {
    border: 1px solid #cbd5e1;
    padding: 3px 4px;
    line-height: 1.2;
    vertical-align: middle;
  }

  .print-sheet-table thead {
    display: table-header-group;
  }

  .print-sheet-table th {
    background: #f1f5f9 !important;
    font-weight: 800;
    color: #0f172a;
    text-transform: uppercase;
    font-size: 6.5pt;
    letter-spacing: 0.02em;
  }

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

  .print-sheet-table tbody tr:nth-child(even) {
    background: #f8fafc;
  }

  .print-empty-note {
    font-size: 7.5pt;
    font-style: italic;
    color: #64748b;
    padding: 6px;
    border: 1px dashed #cbd5e1;
    margin-bottom: 4px;
  }

  /* 3. Steps Checklist (Laufzettel) */
  .print-steps-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 8px;
    border: 1px solid #cbd5e1;
    border-top: none;
    padding: 5px;
    margin-bottom: 6px;
    background: #ffffff;
  }

  .print-step-box {
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    padding: 3px 5px;
    background: #fafafa;
    page-break-inside: avoid;
  }

  .print-step-box.is-done {
    background: #f0fdf4;
    border-color: #bbf7d0;
  }

  .print-step-box.is-problem {
    background: #fef2f2;
    border-color: #fecaca;
  }

  .print-step-head {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 7pt;
    font-weight: 700;
    color: #0f172a;
  }

  .print-step-chk {
    font-size: 8.5pt;
    color: #0f172a;
    width: 10px;
    text-align: center;
  }

  .print-step-num {
    color: #64748b;
    font-size: 6.5pt;
  }

  .print-step-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .print-step-role {
    font-size: 6pt;
    color: #64748b;
    font-weight: 600;
  }

  .print-step-sub {
    font-size: 6.5pt;
    color: #64748b;
    margin-top: 2px;
    display: flex;
    justify-content: space-between;
  }

  .print-step-desc {
    font-size: 6pt;
    color: #475569;
    margin-top: 1px;
    line-height: 1.15;
  }

  /* 4. Notes Area */
  .print-workbench-notes {
    border: 1px solid #cbd5e1;
    border-radius: 3px;
    padding: 4px 6px;
    margin-bottom: 6px;
    background: #ffffff;
    min-height: 16mm;
  }

  .notes-header {
    font-size: 6.5pt;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    margin-bottom: 4px;
  }

  .notes-lines {
    border-bottom: 1px dashed #cbd5e1;
    height: 5mm;
  }

  /* 5. Footer */
  .print-sheet-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #cbd5e1;
    padding-top: 3px;
    font-size: 6.5pt;
    color: #64748b;
  }

  /* 6. Optional Compact Door Leaf QR Sticker Print */
  .sticker-print-wrap {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 0;
  }

  .sticker-print-wrap .qr-sticker-card {
    border: 1.5px solid #0f172a !important;
    box-shadow: none !important;
    width: 90mm !important;
    max-width: 90mm !important;
    background: #ffffff !important;
    page-break-inside: avoid !important;
  }
}

.modal-backdrop[data-v-f0a3e594] {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: rgba(11, 17, 32, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 3500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  overflow: hidden;
  touch-action: none;
}
.modal-container[data-v-f0a3e594] {
  background: var(--md-sys-color-surface-container, #1e293b);
  border: 1px solid var(--md-sys-color-outline-variant, rgba(255, 255, 255, 0.12));
  border-radius: var(--md-sys-shape-xl, 20px);
  box-shadow: var(--md-sys-elevation-level4, 0 16px 40px rgba(0, 0, 0, 0.6));
  width: 100%;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
  touch-action: auto;
}
.modal-sm[data-v-f0a3e594] { max-width: 420px;
}
.modal-md[data-v-f0a3e594] { max-width: 580px;
}
.modal-lg[data-v-f0a3e594] { max-width: 780px;
}
.modal-xl[data-v-f0a3e594] { max-width: 980px;
}
.modal-full[data-v-f0a3e594] { max-width: 95vw; height: calc(100dvh - 32px);
}
.modal-header[data-v-f0a3e594] {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px 20px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant, rgba(255, 255, 255, 0.08));
  gap: 12px;
  flex-shrink: 0;
}
.modal-header-title-group[data-v-f0a3e594] {
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-title[data-v-f0a3e594] {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--md-sys-color-on-surface, #ffffff);
  letter-spacing: -0.01em;
}
.modal-close-btn[data-v-f0a3e594] {
  background: transparent;
  border: none;
  color: var(--text-muted, #94a3b8);
  border-radius: var(--md-sys-shape-full, 9999px);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--md-sys-motion-duration-short, 0.15s) ease;
  flex-shrink: 0;
}
.modal-close-btn[data-v-f0a3e594]:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}
.modal-subtext[data-v-f0a3e594] {
  margin: 0;
  padding: 8px 20px 0 20px;
  font-size: 0.82rem;
  color: var(--text-secondary, #cbd5e1);
  line-height: 1.45;
  flex-shrink: 0;
}
.modal-body[data-v-f0a3e594] {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0; /* Prevents flex container expansion and enforces internal scroll */
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
.modal-footer[data-v-f0a3e594] {
  padding: 12px 20px 14px 20px;
  border-top: 1px solid var(--md-sys-color-outline-variant, rgba(255, 255, 255, 0.08));
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background: var(--md-sys-color-surface-container, #1e293b);
  box-sizing: border-box;
  flex-shrink: 0;
}

/* Transitions */
.modal-fade-enter-active[data-v-f0a3e594],
.modal-fade-leave-active[data-v-f0a3e594] {
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.2, 0, 0, 1);
}
.modal-fade-enter-from[data-v-f0a3e594],
.modal-fade-leave-to[data-v-f0a3e594] {
  opacity: 0;
  transform: scale(0.96);
}
@media (max-width: 640px) {
.modal-backdrop[data-v-f0a3e594] {
    padding: 0;
    align-items: flex-end;
}
.modal-container[data-v-f0a3e594] {
    width: 100vw;
    max-width: 100vw;
    max-height: 92dvh;
    max-height: 92vh;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    border-radius: 16px 16px 0 0;
}
.modal-header[data-v-f0a3e594] {
    padding: 14px 16px 10px 16px;
    background: var(--md-sys-color-surface-container, #1e293b);
}
.modal-title[data-v-f0a3e594] {
    font-size: 1.05rem;
}
.modal-subtext[data-v-f0a3e594] {
    padding: 4px 16px 0 16px;
    font-size: 0.78rem;
}
.modal-body[data-v-f0a3e594] {
    padding: 14px 16px;
}
.modal-footer[data-v-f0a3e594] {
    position: sticky;
    bottom: 0;
    z-index: 20;
    padding: 12px 16px max(14px, env(safe-area-inset-bottom, 14px)) 16px;
    background: var(--md-sys-color-surface-container-high, #243248) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}
}

.confirm-modal-icon-badge[data-v-529c0b87] {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full, 9999px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 158, 11, 0.15);
  color: var(--amber-light, #f59e0b);
  border: 1px solid rgba(245, 158, 11, 0.3);
  margin-right: 10px;
  flex-shrink: 0;
}
.confirm-modal-icon-badge.is-danger[data-v-529c0b87] {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red-danger, #ef4444);
  border-color: rgba(239, 68, 68, 0.3);
}
.confirm-modal-body[data-v-529c0b87] {
  padding: 4px 0 12px 0;
}
.confirm-modal-message[data-v-529c0b87] {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-secondary, #cbd5e1);
  margin: 0;
}

.active-tag-chip[data-v-237a908e] {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: var(--amber-light, #fbbf24);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  transition: all 0.15s ease;
}
.remove-tag-btn[data-v-237a908e] {
  background: none;
  border: none;
  color: var(--amber-light, #fbbf24);
  opacity: 0.75;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.remove-tag-btn[data-v-237a908e]:hover {
  opacity: 1;
  color: #ef4444;
  transform: scale(1.15);
}
.suggested-tag-pill[data-v-237a908e] {
  background: var(--bg-surface, #1e293b);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
  color: var(--text-secondary, #cbd5e1);
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 0.74rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  transition: all 0.15s ease;
}
.suggested-tag-pill[data-v-237a908e]:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--amber-light, #fbbf24);
  color: white;
  transform: translateY(-1px);
}
.suggested-tag-pill[data-v-237a908e]:active {
  transform: translateY(0);
}

.audio-recorder-widget[data-v-ff11b935] {
  margin: 8px 0;
}
.audio-trigger-row[data-v-ff11b935] {
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn-audio-record[data-v-ff11b935] {
  background: var(--md-sys-color-surface-container, #1e293b);
  border: 1px solid var(--md-sys-color-outline-variant, rgba(255, 255, 255, 0.12));
  color: var(--md-sys-color-on-surface, #ffffff);
  padding: 6px 12px;
  border-radius: var(--md-sys-shape-full, 9999px);
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-audio-record[data-v-ff11b935]:hover:not(:disabled) {
  background: var(--md-sys-color-surface-container-highest, #334155);
  border-color: var(--amber-light, #f59e0b);
}
.recording-bar[data-v-ff11b935] {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  padding: 6px 12px;
  border-radius: var(--md-sys-shape-full, 9999px);
  animation: fadeIn 0.2s ease;
}
.recording-pulse-dot[data-v-ff11b935] {
  width: 10px;
  height: 10px;
  background: #ef4444;
  border-radius: 50%;
  animation: pulse-ff11b935 1s infinite;
}
@keyframes pulse-ff11b935 {
0% { transform: scale(0.9); opacity: 0.8;
}
50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 8px #ef4444;
}
100% { transform: scale(0.9); opacity: 0.8;
}
}
.recording-time[data-v-ff11b935] {
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  color: #ef4444;
  font-size: 0.85rem;
}
.recording-label[data-v-ff11b935] {
  font-size: 0.8rem;
  color: #fca5a5;
}
.btn-stop-record[data-v-ff11b935] {
  margin-left: auto;
  background: #ef4444;
  color: white;
  border: none;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.audio-playback-bar[data-v-ff11b935] {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--md-sys-color-surface-container, #1e293b);
  border: 1px solid var(--md-sys-color-outline-variant, rgba(255, 255, 255, 0.1));
  padding: 6px 12px;
  border-radius: var(--md-sys-shape-md, 10px);
}
.audio-player-element[data-v-ff11b935] {
  height: 32px;
  flex: 1;
  outline: none;
}
.btn-remove-audio[data-v-ff11b935] {
  background: transparent;
  border: none;
  color: var(--red-danger, #ef4444);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-remove-audio[data-v-ff11b935]:hover {
  background: rgba(239, 68, 68, 0.15);
}
.audio-error-text[data-v-ff11b935] {
  font-size: 0.75rem;
  color: var(--red-danger, #ef4444);
}

.lightbox-backdrop[data-v-afac1aa2] {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}
.lightbox-content-box[data-v-afac1aa2] {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-image[data-v-afac1aa2] {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--md-sys-shape-md, 12px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}
.lightbox-close-btn[data-v-afac1aa2] {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.lightbox-close-btn[data-v-afac1aa2]:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}
.modal-fade-enter-active[data-v-afac1aa2],
.modal-fade-leave-active[data-v-afac1aa2] {
  transition: opacity 0.2s ease;
}
.modal-fade-enter-from[data-v-afac1aa2],
.modal-fade-leave-to[data-v-afac1aa2] {
  opacity: 0;
}

.qr-scanner-backdrop[data-v-ddc368c8] {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.qr-scanner-card[data-v-ddc368c8] {
  background: var(--bg-surface, #1e293b);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.qr-scanner-header[data-v-ddc368c8] {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.qr-scanner-body[data-v-ddc368c8] {
  padding: 18px;
}
.scanner-viewport[data-v-ddc368c8] {
  position: relative;
  width: 100%;
  height: 240px;
  background: #0f172a;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.scanner-video[data-v-ddc368c8] {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.scanner-target-box[data-v-ddc368c8] {
  position: absolute;
  width: 180px;
  height: 180px;
  border: 2px dashed rgba(251, 191, 36, 0.8);
  border-radius: 12px;
  pointer-events: none;
}
.scanner-laser[data-v-ddc368c8] {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(239, 68, 68, 0.9);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.9);
  animation: scanLaser-ddc368c8 2s infinite ease-in-out;
}
@keyframes scanLaser-ddc368c8 {
0% { top: 0;
}
50% { top: 100%;
}
100% { top: 0;
}
}
.scanner-error-overlay[data-v-ddc368c8] {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  color: var(--text-muted);
}

.order-qr-content[data-v-d0281c51] {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}
.qr-sticker-card[data-v-d0281c51] {
  width: 100%;
  max-width: 380px;
  background: #ffffff;
  color: #0b1120;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  border: 2px solid #e2e8f0;
}
.sticker-header[data-v-d0281c51] {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #0b1120;
  padding-bottom: 6px;
  margin-bottom: 12px;
}
.sticker-brand[data-v-d0281c51] {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}
.sticker-orderno[data-v-d0281c51] {
  font-size: 1.15rem;
  font-weight: 900;
  color: #0b1120;
  font-family: var(--font-mono, monospace);
}
.sticker-body[data-v-d0281c51] {
  display: flex;
  align-items: center;
  gap: 14px;
}
.sticker-qr-code[data-v-d0281c51] {
  background: white;
  padding: 6px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  flex-shrink: 0;
}
.sticker-meta[data-v-d0281c51] {
  flex: 1;
  font-size: 0.82rem;
  line-height: 1.35;
}
.sticker-client[data-v-d0281c51] {
  font-weight: 800;
  font-size: 0.95rem;
  color: #0b1120;
  margin-bottom: 4px;
}
.sticker-comm[data-v-d0281c51] {
  color: #475569;
  font-size: 0.8rem;
  margin-bottom: 4px;
}
.sticker-type[data-v-d0281c51] {
  display: inline-block;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 4px;
}
.sticker-date[data-v-d0281c51] {
  color: #64748b;
  font-size: 0.76rem;
}
.sticker-footer[data-v-d0281c51] {
  margin-top: 12px;
  padding-top: 6px;
  border-top: 1px dashed #cbd5e1;
  font-size: 0.72rem;
  text-align: center;
  color: #64748b;
  font-weight: 600;
}
.qr-link-box[data-v-d0281c51] {
  width: 100%;
  background: var(--md-sys-color-surface-container, #1e293b);
  padding: 12px 14px;
  border-radius: var(--md-sys-shape-md, 10px);
  border: 1px solid var(--md-sys-color-outline-variant, rgba(255, 255, 255, 0.08));
}

.command-palette-backdrop[data-v-72244152] {
  align-items: flex-start;
  padding-top: 50px;
  z-index: 2500;
}
@media (max-width: 640px) {
.command-palette-backdrop[data-v-72244152] {
    padding: 12px 8px;
    padding-top: 12px;
}
.command-palette-box[data-v-72244152] {
    max-height: calc(100dvh - 24px);
    width: 100%;
}
}
