/* =========================================================
   ROOT & BASE TOKENS (aligned with Tailwind root)
   ========================================================= */
:root {
  /* Brand Colors */
  --color-volt-navy: #0b1c33;
  --color-pulse-orange: #ff5c00;
  --color-rce-white: #ffffff;

  /* Semantic aliases – used in your old CSS */
  --brand-volt-navy: var(--color-volt-navy);
  --brand-rce-white: var(--color-rce-white);

  --color-background: #0b1c33;
  --color-surface: #ffffff;

  --color-border: #e0e5ef;
  --color-border-light: #edf1f7;

  --color-text-primary: #0b1c33;
  --color-text-secondary: #58627a;
  --color-text-muted: #9aa4bc;

  --color-accent: var(--color-pulse-orange);
  --color-accent-dark: #e55100;
  --color-accent-alpha: rgba(255, 92, 0, 0.12);

  --color-error: #c53030;
  --color-error-alpha: rgba(197, 48, 48, 0.1);
  --color-warning: #d97706;
  --color-warning-alpha: rgba(217, 119, 6, 0.1);
  --color-success: #059669;
  --color-success-alpha: rgba(5, 150, 105, 0.1);
  --color-info: #2563eb;
  --color-info-alpha: rgba(37, 99, 235, 0.1);

  /* Radii etc. compatible mit Tailwind-Root */
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-2xl: 1rem;
  --radius-3xl: 1.5rem;

  --default-transition-duration: 0.15s;
  --default-transition-timing-function: cubic-bezier(.4,0,.2,1);
}

/* =========================================================
   BASIC RESET & TYPOGRAPHY
   (leicht, damit Tailwind weiter funktioniert)
   ========================================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: var(--color-text-primary);
  background-color: var(--color-background);
  font-size: 16px;
  scroll-behavior: smooth;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--color-text-primary);
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 2rem;
  margin-bottom: 1.25rem;
}

h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

p {
  margin-bottom: 1rem;
  color: var(--color-text-primary);
  font-size: 1.1rem;
  line-height: 1.7;
}

/* Links */
a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

a:hover {
  color: var(--color-accent-dark);
  text-decoration: underline;
}

/* Utility */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.mb-0        { margin-bottom: 0; }

/* =========================================================
   APP LAYOUT (merged from layout.css + styles.css)
   ========================================================= */

/* Main Layout Container */
.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: var(--color-background);
}

/* Main area below header */
.app-main {
  display: flex;
  margin-top: 70px; /* matches .app-header height */
  min-height: calc(100vh - 70px);
}

/* Content Area */
.app-content {
  flex: 1;
  margin-left: 280px;
  padding: 2rem;
  background-color: var(--brand-volt-navy);
  min-height: calc(100vh - 70px);
  width: calc(100vw - 280px);
  max-width: none;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

/* Responsive fixes for full-width layout */
@media (max-width: 1024px) {
  .app-content {
    width: 100vw !important;
    margin-left: 0 !important;
  }
}
@media (max-width: 768px) {
  .app-header { padding: 0 1rem; }
  .top-nav    { display: none; }
  .app-content {
    width: 100vw !important;
    margin-left: 0 !important;
    padding: 1rem;
  }
}
@media (max-width: 480px) {
  .app-content { padding: 0.75rem; }
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.sidebar-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* Sidebar Collapsed State */
.app-layout.sidebar-collapsed .app-sidebar {
  width: 60px;
}
.app-layout.sidebar-collapsed .app-content {
  margin-left: 60px;
  width: calc(100vw - 60px);
}
.app-layout.sidebar-collapsed .sidebar-nav-text,
.app-layout.sidebar-collapsed .sidebar-section-title {
  opacity: 0;
  visibility: hidden;
  width: 0;
  overflow: hidden;
}

/* Header */
.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 70px;
  background-color: var(--brand-rce-white);
  border-bottom: 2px solid var(--color-border);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  box-shadow: 0 2px 10px rgba(11, 28, 51, 0.08);
}

.app-header .brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.app-header .brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}
.app-header .brand-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0;
}
.app-header .brand-subtitle {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin: 0;
  font-weight: 400;
}

/* Language Switcher */
.language-switcher {
  display: flex;
  align-items: center;
  margin: 0 1rem;
}

.language-switcher form {
  margin: 0;
}

.language-switcher #language-select {
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background-color: var(--brand-rce-white);
  color: var(--color-text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%230B1C33' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 12px;
  padding-right: 2.5rem;
}

.language-switcher #language-select:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.language-switcher #language-select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-alpha);
}

@media (max-width: 768px) {
  .language-switcher {
    margin: 0 0.5rem;
  }
  .language-switcher #language-select {
    font-size: 0.75rem;
    padding: 0.375rem 2rem 0.375rem 0.5rem;
  }
}

/* Old header toggle - hidden */
.sidebar-toggle { display: none; }

/* Mobile sidebar toggle */
.mobile-sidebar-toggle {
  background: none;
  border: none;
  color: var(--color-text-primary);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  margin-right: 0.5rem;
  display: none;
}
.mobile-sidebar-toggle:hover {
  background-color: var(--color-surface);
  color: var(--color-accent);
}
@media (max-width: 1024px) {
  .mobile-sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* New sidebar toggle arrow (optional) */
.sidebar-toggle-arrow {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  border-radius: 10px;
  color: #0b1c33;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2147483000;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  background-color: #ffffff;
}
.sidebar-toggle-arrow::before {
  content: "";
  display: block;
  width: 12px;
  height: 12px;
  border: solid currentColor;
  border-width: 0 3px 3px 0;
  transform: rotate(135deg);
  box-sizing: border-box;
  transition: transform 0.3s ease;
}
.app-layout.sidebar-collapsed .sidebar-toggle-arrow::before {
  transform: rotate(-45deg);
}
.sidebar-toggle-arrow:hover {
  background: #e55100;
}
@media (max-width: 1024px) {
  .sidebar-toggle-arrow { display: none; }
}

/* Unified Navigation (header) */
.unified-nav {
  display: flex;
  gap: 2rem;
  align-items: center;
  flex: 1;
  justify-content: flex-end;
  max-width: none;
}
.nav-section {
  display: flex;
  gap: 1rem;
  align-items: center;
}
.nav-section.main-nav { margin-right: 2rem; }
.nav-section.user-section{ margin-left: 0; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-text-primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  position: relative;
  white-space: nowrap;
}
.nav-link:hover {
  color: var(--color-accent);
  text-decoration: none;
}
.nav-link.active {
  color: var(--color-accent);
  background-color: var(--color-accent-alpha);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(255, 92, 0, 0.15);
}
.nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* User Menu (merged) */
.user-menu {
  position: relative;
}

.user-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--color-accent);
  color: white;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.user-circle:hover {
  background-color: var(--color-accent-dark);
  transform: scale(1.05);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 8px 25px rgba(11, 28, 51, 0.15);
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 1001;
}
.user-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.user-dropdown-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  color: var(--color-text-primary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border-bottom: 1px solid var(--color-border-light);
  transition: all 0.2s ease;
}
.user-dropdown-link:first-child {
  border-radius: 8px 8px 0 0;
}
.user-dropdown-link:last-child {
  border-bottom: none;
  border-radius: 0 0 8px 8px;
}
.user-dropdown-link:hover {
  background-color: var(--color-surface);
  color: var(--color-accent);
  text-decoration: none;
}
.user-dropdown-link.logout {
  color: var(--color-error);
}
.user-dropdown-link.logout:hover {
  background-color: var(--color-error-alpha);
  color: var(--color-error);
}

/* Sidebar - Fixed on desktop */
.app-sidebar {
  width: 280px;
  background-color: var(--brand-rce-white);
  border-right: 2px solid var(--color-border);
  padding: 1.5rem 0;
  overflow-y: auto;
  position: fixed;
  left: 0;
  top: 70px;
  bottom: 0;
  z-index: 10000;
  transition: all 0.3s ease;
}

.sidebar-section { margin-bottom: 2rem; }

.sidebar-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 1rem 1.5rem;
}

.sidebar-nav {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sidebar-nav-item {
  margin: 0;
}
.sidebar-nav-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  color: var(--color-text-primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}
.sidebar-nav-link:hover {
  color: var(--color-accent);
  text-decoration: none;
}
.sidebar-nav-link.active {
  background-color: var(--color-accent-alpha);
  color: var(--color-accent);
  border-left-color: var(--color-accent);
  font-weight: 600;
}
.sidebar-nav-icon {
  width: 20px;
  height: 20px;
  margin-right: 0.75rem;
  flex-shrink: 0;
}
.sidebar-nav-text {
  flex: 1;
}

/* Responsive Sidebar (mobile slide-in) */
@media (max-width: 1024px) {
  .app-sidebar {
    transform: translateX(-100%);
  }
  .app-sidebar.show {
    transform: translateX(0);
  }
  .sidebar-overlay {
    display: block;
  }
}

/* =========================================================
   BUTTONS – BASE, PRIMARY, SECONDARY
   (aligned with Tailwind .btn-primary idea)
   ========================================================= */

.btn,
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;

  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-xl);

  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;

  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;

  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease,
    border-color 0.2s ease;
}

/* PRIMARY – orange filled */
.btn-primary {
  background-color: var(--color-pulse-orange);
  color: var(--color-rce-white);
  box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
}

.btn-primary:hover {
  background-color: var(--color-accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.15),
              0 8px 10px -6px rgba(0,0,0,0.15);
}

/* SECONDARY – outlined, neutral (Textfarbe kannst du mit Tailwind-Klasse überschreiben, z.B. text-rce-white) */
.btn-secondary {
  background-color: transparent;
  color: var(--color-text-primary);
  border-color: var(--color-border);
}

.btn-secondary:hover {
  background-color: rgba(255,255,255,0.06);
  border-color: var(--color-border-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.btn-disabled {
  opacity: 0.5;
  pointer-events: none;
}

.btn-danger {
  background: var(--color-danger);
  color: white;
}
.btn-danger:hover {
  background: var(--color-danger-hover);
}


/* =========================================================
   PAGE / SECTION / CARDS / FORMS (from styles.css)
   ========================================================= */

.page-header {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2rem 0;
}

.page-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 1rem;
}

.page-subtitle {
  font-size: 1.25rem;
  color: var(--color-text-secondary);
  margin-bottom: 2rem;
}

.page-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Cards */
.card,
.overview-card {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(11, 28, 51, 0.08);
  border: 1px solid var(--color-border);
  margin-bottom: 2rem;
  transition: all 0.2s ease;
}

.card:hover,
.overview-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(11, 28, 51, 0.12);
}

/* Quick Links */
.quick-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.quick-link {
  background-color: var(--color-accent);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  display: inline-block;
}
.quick-link:hover {
  background-color: var(--color-accent-dark);
  transform: translateY(-1px);
  text-decoration: none;
  color: white;
}

/* Forms */
.form-group { margin-bottom: 1.5rem; }

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--color-text-primary);
  font-size: 0.95rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--color-border);
  border-radius: 6px;
  font-size: 1rem;
  transition: all 0.2s ease;
  background-color: white;
  color: var(--color-text-primary);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(255, 92, 0, 0.1);
}

/* Sections */
.section {
  margin-bottom: 3rem;
}
.section-header {
  margin-bottom: 2rem;
  text-align: center;
}
.section-title {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 1rem;
}
.section-subtitle {
  font-size: 1.25rem;
  color: var(--color-text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* Alerts */
.alert {
  padding: 1rem 1.5rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  border-left: 4px solid;
}
.alert-success {
  background-color: var(--color-success-alpha);
  border-left-color: var(--color-success);
  color: var(--color-success);
}
.alert-error {
  background-color: var(--color-error-alpha);
  border-left-color: var(--color-error);
  color: var(--color-error);
}
.alert-warning {
  background-color: var(--color-warning-alpha);
  border-left-color: var(--color-warning);
  color: var(--color-warning);
}
.alert-info {
  background-color: var(--color-info-alpha);
  border-left-color: var(--color-info);
  color: var(--color-info);
}

/* Breadcrumb */
.breadcrumb {
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.breadcrumb-item {
  color: var(--color-text-secondary);
}
.breadcrumb-item.active {
  color: var(--color-text-primary);
  font-weight: 500;
}

/* Simple grid helpers (kept minimal, Tailwind macht den Rest) */
.grid { display: grid; gap: 2rem; }

/* =========================================================
   DVP-ONLY SKIN (sidebar + collapsed) from layout.css
   ========================================================= */

.app-layout.dvp-mode #appSidebar {
  background: #ffffff;
  border-right: 1px solid #E6EEF7;
  box-shadow: 0 0 32px rgba(11, 28, 51, 0.04);
  color: #0B1C33;
  overflow: hidden;
}

/* Sidebar content wrapper */
.app-layout.dvp-mode #appSidebar .dvp-side-nav { padding: 16px; }

/* Section headings */
.app-layout.dvp-mode #appSidebar .dvp-title {
  font-weight: 700;
  font-size: .95rem;
  margin-bottom: 10px;
  color: #0B1C33;
}

/* Actions */
.app-layout.dvp-mode #appSidebar .dvp-actions {
  display: grid;
  gap: 8px;
}
.app-layout.dvp-mode #appSidebar .dvp-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: #F7FAFD;
  border: 1px solid #D6E0EA;
  color: #0B1C33;
  border-radius: 12px;
  cursor: pointer;
  transition: transform .06s ease, box-shadow .12s ease, background .12s ease;
}
.app-layout.dvp-mode #appSidebar .dvp-btn:hover {
  background: #EEF5FB;
  box-shadow: 0 2px 8px rgba(11,28,51,.06);
}
.app-layout.dvp-mode #appSidebar .dvp-btn:active {
  transform: translateY(1px);
}
.app-layout.dvp-mode #appSidebar .dvp-btn svg {
  width: 18px;
  height: 18px;
}

/* Variants */
.app-layout.dvp-mode #appSidebar .dvp-btn.is-primary {
  background: #FF6B00;
  border-color: #E75C00;
  color: #fff;
}
.app-layout.dvp-mode #appSidebar .dvp-btn.is-primary:hover { filter: brightness(.98); }

.app-layout.dvp-mode #appSidebar .dvp-btn.is-danger {
  background: #FFF6F6;
  border-color: #F2C2C2;
  color: #8B1E1E;
}
.app-layout.dvp-mode #appSidebar .dvp-btn.is-danger:hover { background: #FFECEC; }

.app-layout.dvp-mode #appSidebar .dvp-btn.is-disabled {
  opacity: .55;
  pointer-events: none;
}

/* Navigation buttons */
.app-layout.dvp-mode #appSidebar .dvp-links {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}
.app-layout.dvp-mode #appSidebar .dvp-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: #FFFFFF;
  border: 1px solid #D6E0EA;
  color: #0B1C33;
  text-decoration: none;
  border-radius: 12px;
  transition: transform .06s ease, box-shadow .12s ease, background .12s ease;
}
.app-layout.dvp-mode #appSidebar .dvp-link:hover {
  background: #F7FAFD;
  box-shadow: 0 2px 8px rgba(11,28,51,.06);
}
.app-layout.dvp-mode #appSidebar .dvp-link:active { transform: translateY(1px); }
.app-layout.dvp-mode #appSidebar .dvp-link svg {
  width: 18px;
  height: 18px;
}

/* Collapsed sidebar icon rail */
.app-layout.sidebar-collapsed.dvp-mode #appSidebar {
  width: 60px;
  overflow-y: hidden;
  padding-top: 8px;
}

/* trim inner padding so content fits */
.app-layout.sidebar-collapsed.dvp-mode #appSidebar .dvp-side-nav {
  padding: 8px 8px;
}

/* hide titles + labels when collapsed */
.app-layout.sidebar-collapsed.dvp-mode #appSidebar .dvp-title,
.app-layout.sidebar-collapsed.dvp-mode #appSidebar .dvp-link span,
.app-layout.sidebar-collapsed.dvp-mode #appSidebar .dvp-btn span {
  display: none;
}

/* make items square, centered icons */
.app-layout.sidebar-collapsed.dvp-mode #appSidebar .dvp-links,
.app-layout.sidebar-collapsed.dvp-mode #appSidebar .dvp-actions {
  gap: 6px;
}

.app-layout.sidebar-collapsed.dvp-mode #appSidebar .dvp-link,
.app-layout.sidebar-collapsed.dvp-mode #appSidebar .dvp-btn {
  width: 44px;
  height: 44px;
  padding: 10px;
  margin: 0 auto;
  justify-content: center;
  border-radius: 12px;
}

/* icon sizing in collapsed mode */
.app-layout.sidebar-collapsed.dvp-mode #appSidebar .dvp-link svg,
.app-layout.sidebar-collapsed.dvp-mode #appSidebar .dvp-btn svg {
  width: 18px;
  height: 18px;
}

/* Base toggle styling */
#sidebarToggle {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 0;
  border-radius: 10px;
  background: #fff;
  color: #0b1c33;
  cursor: pointer;

  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  z-index: 9999;   /* ← always on top */
  transition: right .15s ease;
}

#sidebarToggle:hover {
  background: #e55100;
  color: #ffffff;
}

/* keep the toggle arrow always visible and aligned to the rail edge */
.app-layout.dvp-mode #sidebarToggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
}

/* Position for EXPANDED STATE */
.app-layout.dvp-mode #sidebarToggle {
  right: -12px;   /* slightly overlapping sidebar border */
}

/* Position for COLLAPSED STATE */
.app-layout.sidebar-collapsed.dvp-mode #sidebarToggle {
  right: -14px;   /* consistent visible edge */
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

#appSidebar {
  overflow: visible !important;
}

/* =========================================================
   DATA TABLES (unchanged)
   ========================================================= */

.table-wrap {
  border:1px solid var(--tbl-stroke);
  border-radius:10px;
  overflow:auto;
  background:var(--tbl-panel);
  box-shadow:0 8px 18px rgba(0,0,0,.25);
}

.data-table {
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  table-layout:fixed;
  font-size:14px;
  color:var(--tbl-text);
}
.data-table col{ width:auto; }

.data-table th,
.data-table td{
  padding:10px 12px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.data-table thead th{
  position:sticky; top:0; z-index:2;
  background:var(--tbl-header);
  color:var(--tbl-text-weak);
  font-weight:700;
  text-align:left;
  border-bottom:1px solid var(--tbl-stroke);
}

/* ==========================================================
   Global Data Tables
   Usage:
     <div class="table-wrap">
       <table class="data-table table--dark"> … </table>
     </div>

   Optional modifiers:
     .table--dark      → dark zebra (default DVP look)
     .table--light     → light surface variant
     .is-num / .is-narrow on columns
========================================================== */

/* Shell */
.table-wrap{
  border:1px solid var(--tbl-stroke);
  border-radius:10px;
  overflow:auto;
  background:var(--tbl-panel);
  box-shadow:0 8px 18px rgba(0,0,0,.25);
}

/* Base table */
.data-table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  table-layout:fixed;                /* prevents jumps on <select> */
  font-size:14px;
  color:var(--tbl-text);             /* default text color */
}
.data-table col{ width:auto; }

/* Cells */
.data-table th,
.data-table td{
  padding:10px 12px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* Header (sticky, no hover) */
.data-table thead th{
  position:sticky; top:0; z-index:2;
  background:var(--tbl-header);
  color:var(--tbl-text-weak);
  font-weight:700;
  text-align:left;
  border-bottom:1px solid var(--tbl-stroke);
}

/* Reasonable minimums so columns don’t collapse */
.data-table thead th:nth-child(1){ min-width:90px; }   /* Level    */
.data-table thead th:nth-child(2){ min-width:220px; }  /* Name     */
.data-table thead th:nth-child(3){ min-width:130px; }  /* Sample   */
.data-table thead th:nth-child(4){ min-width:130px; }  /* Category */
.data-table thead th:nth-child(5){ min-width:95px;  }  /* DUT      */
.data-table thead th:nth-child(6){ min-width:110px; }  /* Duration */
.data-table thead th:nth-child(7){ min-width:130px; }  /* Standard */
.data-table thead th:nth-child(8){ min-width:130px; }  /* Est/pc   */
.data-table thead th:nth-child(9){ min-width:130px; }  /* Est total*/

.data-table .is-num{ text-align:right; }
.data-table .is-narrow{ width:120px; }

/* Column resizers (optional) */
.data-table thead th{ position:relative; }
.data-table thead th .col-resizer{
  position:absolute; top:0; right:-3px; width:6px; height:100%;
  cursor:col-resize; user-select:none;
}
.data-table thead th .col-resizer::after{
  content:""; position:absolute; right:2px; top:8px; bottom:8px; width:2px;
  background:rgba(255,255,255,.18); border-radius:1px;
  transition:background .12s ease, opacity .12s ease;
}
.data-table thead th .col-resizer:hover::after,
body.dvp-resizing .data-table thead th .col-resizer::after{
  background:var(--tbl-orange); opacity:.9;
}
body.dvp-resizing{ cursor:col-resize !important; }

/* Filters row (if present) */
.filters-row select{
  margin-top:6px; width:100%; height:30px; padding:0 8px; border-radius:6px;
  border:1px solid var(--tbl-stroke);
  background:#0f2743; color:var(--tbl-text);
}

/* -------------------- THEMES -------------------- */

/* Dark (DVP default) */
.table--dark tbody tr{
  transition:background .15s ease, box-shadow .15s ease;
  cursor:pointer;
  border-bottom:1px solid var(--tbl-stroke);
  background:var(--tbl-row);
}
.table--dark tbody tr:nth-child(even){ background:var(--tbl-row-alt); }
.table--dark tbody tr:hover > td{ background:var(--tbl-row-hover); }

/* Selected rows (same orange wash as DVP) */
.table--dark tbody tr.selected > td,
.table--dark tbody tr:has(td .row-check:checked) > td{
  position:relative;
  color:#0b1a2b !important;
  background:var(--tbl-orange-soft) !important;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.05);
  background-clip:padding-box;
}
.table--dark tbody tr.selected:nth-of-type(even) > td{
  background:var(--tbl-orange-soft-2) !important;
}
.table--dark tbody tr.selected > td:first-child{
  box-shadow:inset 3px 0 0 0 var(--tbl-orange),
             inset 0 0 0 1px rgba(255,255,255,.05);
}

/* Light variant (if you ever need a white-surface table) */
.table--light{
  color:var(--color-text-primary, #0B1C33);
  background:var(--color-surface, #F8F9FB);
}
.table--light thead th{
  background:var(--color-surface-dark, #E8EBF0);
  color:var(--color-text-primary, #0B1C33);
}
.table--light tbody tr{ background:#FFFFFF; border-bottom:1px solid var(--tbl-stroke); }
.table--light tbody tr:nth-child(even){ background:#F7F9FC; }
.table--light tbody tr:hover > td{ background:#EEF3FA; }

/* Hidden data columns never affect layout */
.data-table th.hidden,
.data-table td.hidden { display:none !important; pointer-events:none !important; }

/* Pagination block (sticky when used inside .table-wrap) */
.table-pagination{
  position:sticky; bottom:0;
  display:flex; gap:10px; align-items:center; justify-content:flex-end;
  padding:10px; border-top:1px solid var(--tbl-stroke); background:var(--tbl-panel);
}

/* Optional: disable text selection for data tables */
.data-table,
.data-table *:not(input):not(textarea):not(select):not(button){
  -webkit-user-select:none; -moz-user-select:none; -ms-user-select:none; user-select:none;
}
.data-table ::selection{ background:transparent; }

