:root {
  --vx-navy-950: #00172f;
  --vx-navy-900: #022344;
  --vx-blue: #087cf0;
  --vx-mint: #19bfa3;
  --vx-mint-dark: #0c8d7d;
  --vx-mint-soft: #e9fbf7;
  --c-bg: #f6f8fc;
  --c-surface: #ffffff;
  --c-sidebar: #001b38;
  --c-sidebar-hover: rgba(25, 191, 163, .15);
  --c-sidebar-active: #08766f;
  --c-sidebar-text: #b7c9dc;
  --c-sidebar-text-bright: #ffffff;
  --c-sidebar-border: rgba(255, 255, 255, .08);
  --c-accent: #0c9f91;
  --c-accent-dark: #08766f;
  --c-accent-light: #e9fbf7;
  --c-text: #071b3c;
  --c-text-muted: #5b6f89;
  --c-border: #dfe7f0;
  --sidebar-width: 304px;
  --topbar-height: auto;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 3px 14px rgba(1, 27, 61, .07);
  --shadow-md: 0 12px 30px rgba(1, 27, 61, .12);
}

[data-theme="light"] {
  color-scheme: light;
}

[data-theme="dark"] {
  color-scheme: dark;
  --c-bg: #071426;
  --c-surface: #0d1c31;
  --c-text: #edf5ff;
  --c-text-muted: #9bb0ca;
  --c-border: #233754;
  --c-accent-light: #102d38;
  --c-danger-light: #351d2a;
  --shadow-sm: 0 3px 14px rgba(0, 0, 0, .26);
  --shadow-md: 0 12px 30px rgba(0, 0, 0, .34);
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(circle at 85% 4%, rgba(8, 124, 240, .055), transparent 24rem),
    var(--c-bg);
}

/* Varexon Sidebar */
.sidebar {
  background:
    radial-gradient(circle at 8% 17%, rgba(25, 191, 163, .16), transparent 30%),
    linear-gradient(180deg, var(--vx-navy-950) 0%, #022b52 100%);
  border: 0;
  box-shadow: 8px 0 30px rgba(0, 19, 43, .12);
}

.sidebar-header {
  padding: 20px 22px 15px;
  border-color: var(--c-sidebar-border);
}

.sidebar-brand {
  display: block;
  width: 235px;
  max-width: 100%;
  height: 51px;
  overflow: hidden;
}

.app-logo-sidebar {
  width: 235px;
  height: auto;
  max-width: none;
  filter: brightness(0) invert(1);
}

.service-identity {
  margin-top: 13px;
  padding: 9px 11px;
  border: 1px solid rgba(50, 221, 196, .36);
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(25, 191, 163, .2), rgba(8, 124, 240, .08));
  display: flex;
  align-items: center;
  gap: 11px;
  color: #fff;
}

.service-identity-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .09);
  color: #42dec9;
  font-size: 1rem;
}

.service-identity div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.service-identity small {
  color: rgba(255, 255, 255, .55);
  font-size: .61rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.service-identity strong {
  margin-top: 4px;
  color: #fff;
  font-size: .88rem;
  letter-spacing: .2px;
}

.sidebar-user {
  padding: 14px 22px;
  border-bottom: 1px solid var(--c-sidebar-border);
  display: flex;
  align-items: center;
  gap: 11px;
}

.sidebar-user-avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #32d8bf, #08766f);
  color: #fff;
  font-weight: 800;
}

.sidebar-user-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.sidebar-user-copy strong {
  overflow: hidden;
  color: #fff;
  font-size: .82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-copy small {
  margin-top: 3px;
  color: rgba(255, 255, 255, .58);
  font-size: .68rem;
}

.sidebar-section-label {
  padding: 15px 18px 6px;
  color: rgba(255, 255, 255, .55);
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: 1.15px;
  opacity: 1;
}

.employee-list {
  padding: 0 10px;
}

.employee-item,
.btn-sidebar {
  min-height: 42px;
  padding: 9px 13px;
  border-radius: 9px;
  color: rgba(255, 255, 255, .88);
  font-size: .84rem;
}

.employee-item:hover,
.btn-sidebar:hover {
  background: var(--c-sidebar-hover);
  color: #fff;
}

.employee-item.active,
.btn-sidebar.active-view {
  background: linear-gradient(90deg, #08766f 0%, #075694 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 5px 12px rgba(0, 0, 0, .12);
}

.employee-item .emp-avatar {
  background: rgba(25, 191, 163, .18);
  color: #72ead7;
}

.employee-item.active .emp-avatar {
  background: rgba(255, 255, 255, .16);
}

.sidebar-actions {
  padding: 7px 10px;
}

.sidebar-divider {
  margin: 8px 10px;
}

.sidebar-gear-btn {
  color: rgba(255, 255, 255, .76);
}

.sidebar-status {
  padding: 13px 18px;
  background: rgba(0, 12, 29, .18);
}

/* Header with dedicated workspace row */
.topbar {
  min-height: 132px;
  height: auto;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 68px auto;
  justify-content: stretch;
  align-items: stretch;
  gap: 0;
  background: var(--c-surface);
  border-color: var(--c-border);
  box-shadow: 0 2px 8px rgba(0, 28, 62, .04);
}

.topbar-main,
.topbar-toolbar {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-main {
  padding: 0 24px;
}

.topbar-heading {
  min-width: 0;
  margin-right: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.topbar-main-right {
  display: flex;
  align-items: center;
  gap: 11px;
}

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

.theme-toggle,
.mobile-menu-btn {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 1px solid var(--c-border);
  border-radius: 10px;
  background: var(--c-surface);
  color: var(--c-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color .18s, color .18s, background .18s;
}

.theme-toggle:hover,
.mobile-menu-btn:hover {
  border-color: var(--vx-mint);
  color: var(--vx-mint-dark);
}

.mobile-menu-btn {
  position: static;
  margin-right: 18px;
  box-shadow: none;
}

.topbar-service {
  color: var(--vx-mint-dark);
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

.topbar h1 {
  max-width: min(58vw, 760px);
  overflow: hidden;
  color: var(--c-text);
  font-size: 1.1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-profile {
  min-width: 194px;
  height: 48px;
  padding: 5px 13px 5px 6px;
  border: 1px solid var(--c-border);
  border-radius: 11px;
  background: var(--c-surface);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #32d8bf, #08766f);
  color: #fff;
  font-weight: 800;
}

.topbar-profile-copy {
  min-width: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
  line-height: 1.2;
}

.topbar-profile-copy strong {
  overflow: hidden;
  font-size: .78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-profile-copy small {
  margin-top: 3px;
  color: var(--c-text-muted);
  font-size: .68rem;
}

.topbar-toolbar {
  min-height: 64px;
  padding: 10px 24px;
  gap: 14px;
  border-top: 1px solid #edf1f6;
  background: #fbfcfe;
}

.topbar-left {
  flex: 1 1 390px;
  gap: 12px;
}

.year-selector {
  flex: 0 0 auto;
  gap: 7px;
}

.year-selector label {
  color: var(--c-text-muted);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .45px;
  text-transform: uppercase;
}

.topbar-search {
  position: relative;
  width: min(420px, 36vw);
}

.topbar-search > i {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 13px;
  color: #7890aa;
  font-size: .78rem;
  transform: translateY(-50%);
  pointer-events: none;
}

.topbar-search input {
  min-height: 42px;
  padding-left: 36px;
  border-radius: 9px;
  background: #fff;
}

.topbar-search input:focus,
input:focus,
textarea:focus,
select:focus {
  border-color: var(--vx-mint);
  box-shadow: 0 0 0 3px rgba(25, 191, 163, .12);
}

.topbar-right {
  gap: 7px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}

.topbar-right .btn {
  min-height: 40px;
  padding: 8px 11px;
}

.btn {
  border-radius: 8px;
  font-weight: 650;
}

.btn-primary {
  background: linear-gradient(90deg, var(--vx-mint-dark), var(--vx-mint));
  box-shadow: 0 4px 10px rgba(12, 141, 125, .16);
}

.btn-primary:hover {
  background: linear-gradient(90deg, #077166, #0da990);
}

.btn-icon {
  background: #fff;
}

/* Service identity in the content area */
.content-area {
  min-width: 0;
  padding: 22px 24px 30px;
}

.content-area > * {
  width: 100%;
  max-width: 1368px;
  margin-right: auto;
  margin-left: auto;
}

/* Terminplanung is a full workspace, not a modal dialog. */
.schedule-page {
  display: block;
  padding-bottom: 24px;
}

.schedule-page-head {
  margin-bottom: 16px;
  padding: 22px 26px;
  border: 1px solid rgba(25, 191, 163, .35);
  border-radius: 16px;
  background:
    radial-gradient(circle at 92% 15%, rgba(69, 226, 202, .18), transparent 22rem),
    linear-gradient(120deg, #00284c, #075e70);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.schedule-back {
  margin-bottom: 17px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, .78);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.schedule-back:hover,
.schedule-back:focus-visible {
  color: #fff;
}

.schedule-page-eyebrow {
  margin-bottom: 3px;
  color: #59e5d1;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.schedule-page-head h2 {
  margin-bottom: 5px;
  font-size: clamp(1.65rem, 2.4vw, 2.25rem);
  line-height: 1.15;
}

.schedule-page-head p:last-child {
  color: rgba(255, 255, 255, .78);
}

.schedule-page-body {
  min-width: 0;
}

.schedule-toolbar-shell {
  position: sticky;
  top: 0;
  z-index: 20;
  margin-bottom: 14px;
}

.schedule-page .schedule-toolbar {
  position: relative;
  top: auto;
  z-index: 8;
  margin-bottom: 0;
  border: 1px solid var(--c-border);
  border-radius: 13px;
  box-shadow: var(--shadow-sm);
}

/* The opened calendar is anchored to the year/quarter toolbar, not to the table. */
.schedule-toolbar-shell .schedule-panel-calendar {
  top: calc(100% - 7px);
  right: 0;
  z-index: 30;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
}

.schedule-toolbar-shell.calendar-open .schedule-panel-calendar {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.schedule-workspace {
  overflow: hidden;
}

.wartung-hero {
  position: relative;
  min-height: 174px;
  margin-bottom: 20px;
  padding: 31px 42px;
  border: 1px solid rgba(43, 214, 190, .56);
  border-radius: 19px;
  overflow: hidden;
  background:
    radial-gradient(circle at 85% 35%, rgba(58, 228, 204, .24), transparent 25%),
    linear-gradient(108deg, #001c3c 0%, #07516d 57%, #0a9a8e 100%);
  color: #fff;
  box-shadow: 0 7px 18px rgba(0, 50, 70, .15);
}

.wartung-hero:not(:last-child) {
  margin-bottom: 20px;
}

.wartung-hero::after {
  content: "";
  position: absolute;
  inset: 0 0 0 auto;
  width: 260px;
  opacity: .22;
  background-image: radial-gradient(rgba(255, 255, 255, .46) 1.2px, transparent 1.2px);
  background-size: 15px 15px;
  mask-image: linear-gradient(90deg, transparent, #000);
}

.wartung-hero-copy {
  position: relative;
  z-index: 2;
  max-width: 720px;
}

.wartung-eyebrow {
  margin-bottom: 7px;
  color: rgba(255, 255, 255, .7);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: 1.15px;
  text-transform: uppercase;
}

.wartung-hero h2 {
  font-size: clamp(1.75rem, 2.8vw, 2.35rem);
  line-height: 1.1;
  letter-spacing: -.55px;
}

.wartung-hero-accent {
  display: block;
  width: 52px;
  height: 4px;
  margin: 17px 0 15px;
  border-radius: 99px;
  background: #45e2ca;
}

.wartung-hero-copy > p:last-child {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, .82);
  font-size: .84rem;
}

.wartung-hero-icon {
  position: absolute;
  z-index: 1;
  top: 20px;
  right: 76px;
  width: 140px;
  height: 140px;
  border: 2px solid rgba(255, 255, 255, .12);
  border-radius: 30px;
  transform: rotate(-9deg);
  display: grid;
  place-items: center;
  color: rgba(100, 246, 224, .34);
  font-size: 5.7rem;
}

.empty-state {
  min-height: 280px;
  height: auto;
  padding: 35px;
  border: 1px dashed #cbd8e6;
  border-radius: 14px;
  background: rgba(255, 255, 255, .7);
}

.project-table-wrap,
.battery-table-wrap,
.modal {
  border-radius: 13px;
  border-color: var(--c-border);
  box-shadow: var(--shadow-sm);
}

.modal-header {
  border-color: var(--c-border);
  background: linear-gradient(180deg, #fff, #fbfcfe);
}

.form-group input,
.form-group textarea,
.form-group select,
.audit-toolbar select {
  border-radius: 9px;
}

/* Shared accessible Varexon selection component */
.vx-native-select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.vx-select {
  position: relative;
  display: inline-block;
  min-width: 0;
  max-width: 100%;
  vertical-align: middle;
}

.form-group > .vx-select,
.year-selector > .vx-select,
.audit-toolbar > .vx-select {
  width: 100%;
}

.year-selector > .vx-select {
  width: 94px;
}

.vx-select__trigger {
  position: relative;
  width: 100%;
  min-height: 42px;
  padding: 9px 42px 9px 13px;
  border: 1.5px solid var(--c-border);
  border-radius: 9px;
  background: var(--c-surface);
  color: var(--c-text);
  font: inherit;
  font-size: .86rem;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(1, 27, 61, .03);
  transition: border-color .18s, box-shadow .18s, background .18s;
}

.vx-select__trigger::after {
  content: "\f078";
  position: absolute;
  top: 50%;
  right: 14px;
  color: var(--vx-mint-dark);
  font-family: "Font Awesome 6 Free";
  font-size: .72rem;
  font-weight: 900;
  transform: translateY(-50%);
  transition: transform .18s;
}

.vx-select__trigger:hover {
  border-color: #78cfc2;
}

.vx-select__trigger:focus-visible,
.vx-select.is-open .vx-select__trigger {
  outline: 0;
  border-color: var(--vx-mint);
  box-shadow: 0 0 0 3px rgba(25, 191, 163, .13);
}

.vx-select.is-open .vx-select__trigger::after {
  transform: translateY(-50%) rotate(180deg);
}

.vx-select.is-disabled {
  opacity: .58;
}

.vx-select.is-disabled .vx-select__trigger {
  cursor: not-allowed;
}

.vx-select__menu {
  position: fixed;
  z-index: 1500;
  padding: 7px;
  overflow: hidden;
  border: 1px solid var(--c-border);
  border-radius: 12px;
  background: var(--c-surface);
  color: var(--c-text);
  box-shadow: 0 18px 48px rgba(0, 19, 43, .22);
  transform-origin: top center;
  animation: vx-select-in .14s ease-out;
}

@keyframes vx-select-in {
  from { opacity: 0; transform: translateY(-4px) scale(.985); }
  to { opacity: 1; transform: none; }
}

.vx-select__search-wrap {
  position: relative;
  margin-bottom: 6px;
}

.vx-select__search-wrap i {
  position: absolute;
  top: 50%;
  left: 12px;
  color: var(--c-text-muted);
  font-size: .78rem;
  transform: translateY(-50%);
  pointer-events: none;
}

.vx-select__search {
  width: 100%;
  min-height: 39px;
  padding: 8px 11px 8px 34px;
  border: 1px solid var(--c-border);
  border-radius: 8px;
  background: #f6f9fc;
  color: var(--c-text);
  font: inherit;
  font-size: .83rem;
}

.vx-select__options {
  max-height: min(310px, 45vh);
  padding: 1px;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.vx-select__option {
  position: relative;
  width: 100%;
  min-height: 40px;
  margin: 2px 0;
  padding: 9px 38px 9px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--c-text);
  font: inherit;
  font-size: .86rem;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
}

.vx-select__option:hover,
.vx-select__option:focus-visible {
  outline: 0;
  background: #f1f6fa;
}

.vx-select__option[aria-selected="true"] {
  background: linear-gradient(90deg, rgba(25, 191, 163, .15), rgba(8, 124, 240, .07));
  color: var(--vx-mint-dark);
  font-weight: 750;
}

.vx-select__option[aria-selected="true"]::after {
  content: "\f00c";
  position: absolute;
  top: 50%;
  right: 13px;
  font-family: "Font Awesome 6 Free";
  font-size: .75rem;
  font-weight: 900;
  transform: translateY(-50%);
}

.vx-select__option:disabled { opacity: .42; cursor: not-allowed; }
.vx-select__option[hidden],
.vx-select__empty[hidden] { display: none; }
.vx-select__empty { padding: 18px 10px; color: var(--c-text-muted); font-size: .82rem; text-align: center; }
.vx-select-backdrop { display: none; }

@media (min-width: 861px) {
  .sidebar {
    transition: width .25s ease, transform .25s ease;
  }

  body.sidebar-collapsed .sidebar {
    width: 0;
    transform: translateX(-100%);
  }

  body.sidebar-collapsed .main-content {
    width: 100%;
  }
}

/* Dark mode keeps the service color while switching work surfaces. */
[data-theme="dark"] body,
[data-theme="dark"] .main-content,
[data-theme="dark"] .content-area {
  background: var(--c-bg);
  color: var(--c-text);
}

[data-theme="dark"] .topbar,
[data-theme="dark"] .topbar-main,
[data-theme="dark"] .topbar-profile,
[data-theme="dark"] .theme-toggle,
[data-theme="dark"] .mobile-menu-btn,
[data-theme="dark"] .modal,
[data-theme="dark"] .modal-header,
[data-theme="dark"] .project-table-wrap,
[data-theme="dark"] .battery-table-wrap,
[data-theme="dark"] .empty-state,
[data-theme="dark"] .mobile-maintenance-controls,
[data-theme="dark"] .audit-toolbar,
[data-theme="dark"] .audit-log-row,
[data-theme="dark"] .schedule-panel,
[data-theme="dark"] .schedule-row,
[data-theme="dark"] .schedule-calendar-item {
  background: var(--c-surface);
  color: var(--c-text);
  border-color: var(--c-border);
}

[data-theme="dark"] .topbar-toolbar,
[data-theme="dark"] thead th,
[data-theme="dark"] .group-row td,
[data-theme="dark"] .quarter-subheader th,
[data-theme="dark"] .time-picker-tabs button,
[data-theme="dark"] .schedule-toolbar,
[data-theme="dark"] .schedule-panel-head,
[data-theme="dark"] .schedule-calendar-day {
  background: #102039;
  color: var(--c-text);
  border-color: var(--c-border);
}

[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select,
[data-theme="dark"] .topbar-search input,
[data-theme="dark"] .vx-select__trigger,
[data-theme="dark"] .vx-select__menu,
[data-theme="dark"] .vx-select__search {
  background: #102039;
  color: var(--c-text);
  border-color: var(--c-border);
}

[data-theme="dark"] .btn-icon,
[data-theme="dark"] .btn-secondary,
[data-theme="dark"] .schedule-time-button {
  background: #13243c;
  color: var(--c-text);
  border-color: var(--c-border);
}

[data-theme="dark"] tbody td,
[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer,
[data-theme="dark"] .audit-change-row {
  border-color: var(--c-border);
}

[data-theme="dark"] tbody tr:hover,
[data-theme="dark"] .vx-select__option:hover,
[data-theme="dark"] .vx-select__option:focus-visible {
  background: #152942;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #38506d;
}

/* Project and battery tables deliberately keep their proven light palette. */
[data-theme="dark"] #project-table-wrap,
[data-theme="dark"] #battery-table-wrap {
  --c-text: #1e293b;
  --c-text-muted: #64748b;
  --c-border: #e2e8f0;
  --c-accent-light: #eff6ff;
  --c-accent-dark: #2563eb;
  color-scheme: light;
}

[data-theme="dark"] #project-table-wrap .project-table-wrap,
[data-theme="dark"] #battery-table-wrap .project-table-wrap {
  background: #fff;
  color: #1e293b;
  border-color: #e2e8f0;
}

[data-theme="dark"] #project-table-wrap table.project-table th,
[data-theme="dark"] #battery-table-wrap table.project-table th {
  background: #1e293b;
  color: #fff;
  border-color: #e2e8f0;
}

[data-theme="dark"] #project-table-wrap table.project-table th.quarter-th,
[data-theme="dark"] #battery-table-wrap table.project-table th.quarter-th,
[data-theme="dark"] #project-table-wrap tr.group-row td,
[data-theme="dark"] #battery-table-wrap tr.group-row td {
  background: #1e3a5f;
  color: #e2eaf4;
}

[data-theme="dark"] #project-table-wrap table.project-table td,
[data-theme="dark"] #battery-table-wrap table.project-table td {
  border-color: #e2e8f0;
}

[data-theme="dark"] #project-table-wrap table.project-table tr.data-row:hover,
[data-theme="dark"] #battery-table-wrap table.project-table tr.data-row:hover {
  background: #f8fafc;
}

@media (min-width: 861px) {
  /* The desktop header belongs to the document flow and scrolls away. */
  .main-content {
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .content-area {
    flex: none;
    min-height: calc(100dvh - 132px);
    overflow: visible;
  }
}

@media (max-width: 1500px) and (min-width: 861px) {
  :root { --sidebar-width: 272px; }

  .sidebar-brand { width: 214px; }
  .app-logo-sidebar { width: 214px; }
  .topbar-toolbar { align-items: flex-start; }
  .topbar-left { flex: 0 1 330px; }
  .topbar-search { width: min(330px, 29vw); }
  .topbar-right .btn { font-size: .75rem; }
}

@media (max-width: 860px) {
  :root { --sidebar-width: min(86vw, 320px); }

  .mobile-menu-btn {
    display: inline-flex;
    position: static;
    width: 42px;
    height: 42px;
    border-color: var(--c-border);
    border-radius: 10px;
    background: #fff;
    color: var(--c-text);
  }

  .topbar {
    position: relative;
    min-height: 0;
    grid-template-rows: auto auto;
    padding: 0;
  }

  .topbar-main {
    width: 100%;
    min-height: 68px;
    padding: 8px 13px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 42px 42px;
    grid-template-rows: 52px auto;
    gap: 7px 8px;
  }

  .topbar-heading {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    margin: 0;
    align-self: center;
  }

  .mobile-menu-btn {
    grid-column: 1;
    grid-row: 1;
    margin: 0;
    align-self: center;
  }

  body.sidebar-open .mobile-menu-btn {
    display: inline-flex;
  }

  .topbar-main-right {
    display: contents;
  }

  .topbar-primary-actions {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
  }

  .topbar-primary-actions .btn {
    min-height: 40px;
  }

  .schedule-page-head {
    padding: 19px 20px;
  }

  .schedule-toolbar-shell {
    position: relative;
    top: auto;
  }

  .schedule-toolbar-shell .schedule-panel-calendar {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .schedule-toolbar-shell.calendar-open .schedule-panel-calendar {
    display: block;
  }

  .theme-toggle {
    grid-column: 3;
    grid-row: 1;
    width: 42px;
    height: 42px;
    align-self: center;
  }

  .topbar h1 {
    max-width: 100%;
    font-size: 1rem;
  }

  .topbar-profile {
    grid-column: 4;
    grid-row: 1;
    min-width: 42px;
    width: 42px;
    height: 42px;
    padding: 2px;
    justify-content: center;
  }

  .topbar-profile-copy {
    display: none;
  }

  .topbar-avatar {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .topbar-toolbar {
    width: 100%;
    min-height: 0;
    padding: 10px 13px 12px;
    display: grid;
    gap: 9px;
  }

  .topbar-left {
    width: 100%;
    display: grid;
    grid-template-columns: 105px minmax(0, 1fr);
    align-items: end;
    gap: 8px;
    padding-left: 0;
  }

  .year-selector {
    width: 100%;
    display: grid;
    gap: 3px;
  }

  .year-selector > .vx-select {
    width: 100%;
  }

  .topbar-search {
    width: 100%;
  }

  .topbar-right {
    width: 100%;
    margin: 0;
    padding-bottom: 2px;
    display: flex;
    gap: 7px;
    overflow-x: auto;
  }

  .topbar-right .btn,
  .topbar-right .btn-primary {
    min-width: max-content;
    min-height: 40px;
    grid-column: auto;
    padding: 8px 11px;
    white-space: nowrap;
  }

  .content-area {
    padding: 13px;
  }

  .wartung-hero {
    min-height: 148px;
    padding: 25px 24px;
    border-radius: 15px;
  }

  .wartung-hero-copy {
    max-width: calc(100% - 62px);
  }

  .wartung-hero h2 {
    font-size: 1.65rem;
  }

  .wartung-hero-copy > p:last-child {
    align-items: flex-start;
    font-size: .76rem;
    line-height: 1.35;
  }

  .wartung-hero-icon {
    top: 34px;
    right: 18px;
    width: 74px;
    height: 74px;
    border-radius: 18px;
    font-size: 2.8rem;
    opacity: .75;
  }

  .empty-state {
    min-height: 240px;
    padding: 25px 18px;
  }
}

@media (max-width: 600px) {
  .vx-select {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .vx-select__menu {
    position: fixed !important;
    z-index: 1601;
    inset: auto 10px calc(10px + env(safe-area-inset-bottom)) !important;
    width: auto !important;
    max-height: min(72vh, 560px);
    padding: 10px;
    border-radius: 17px;
    transform-origin: bottom center;
    animation: vx-select-mobile-in .18s ease-out;
  }

  @keyframes vx-select-mobile-in {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: none; }
  }

  .vx-select__options {
    max-height: calc(min(72vh, 560px) - 66px);
  }

  .vx-select__option {
    min-height: 48px;
    padding: 12px 42px 12px 13px;
  }

  .vx-select-backdrop {
    position: fixed;
    z-index: 1600;
    inset: 0;
    display: block;
    background: rgba(0, 17, 38, .56);
    backdrop-filter: blur(2px);
  }
}

@media (max-width: 420px) {
  .topbar-left {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .topbar-search input {
    font-size: .78rem;
  }

  .wartung-hero {
    padding: 22px 20px;
  }

  .wartung-hero-copy {
    max-width: 100%;
  }

  .wartung-hero-icon {
    display: none;
  }
}
