@charset "UTF-8";
/**
 * Variables
 * Zentrale Design-Tokens und Konfiguration
 */
/**
 * Layout: Sidebar
 * Responsive Navigation Sidebar mit Collapse/Expand Funktionalität
 */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
  pointer-events: none;
}
.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
@media (max-width: 768px) {
  .sidebar-overlay {
    display: block;
  }
  .sidebar-overlay.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }
}

.sidebar {
  width: 80px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  left: 0;
  top: 0;
}
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 280px;
    max-width: 80vw;
    box-shadow: none;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    position: fixed;
    left: 0;
    top: 0;
    will-change: transform;
  }
  .sidebar .nav {
    padding: 0 1.5rem;
  }
  .sidebar .nav-item {
    justify-content: flex-start;
    padding: 0.75rem 1rem;
  }
  .sidebar .nav-item .nav-text {
    opacity: 1;
    max-width: 200px;
  }
  .sidebar .user-profile {
    padding: 1rem 1.5rem 2rem;
    justify-content: flex-start;
  }
  .sidebar .user-profile .user-info {
    opacity: 1;
    max-width: 150px;
  }
}
.sidebar.expanded {
  width: 260px;
}
@media (max-width: 768px) {
  .sidebar.expanded {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
    z-index: 1001;
  }
}
.sidebar.expanded .hamburger-btn .hamburger-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.sidebar.expanded .hamburger-btn .hamburger-line:nth-child(2) {
  opacity: 0;
}
.sidebar.expanded .hamburger-btn .hamburger-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}
.sidebar.expanded .nav {
  padding: 0 1.5rem;
}
.sidebar.expanded .nav-item {
  justify-content: flex-start;
  padding: 0.75rem 1rem;
}
.sidebar.expanded .nav-item .nav-text {
  opacity: 1;
  max-width: 200px;
}
.sidebar.expanded .user-profile {
  padding: 1rem 1.5rem 0;
  padding-bottom: 2rem;
  justify-content: flex-start;
}
.sidebar.expanded .user-profile .user-info {
  opacity: 1;
  max-width: 150px;
}
.sidebar.expanded .user-profile .logout-btn {
  display: flex;
}
.sidebar .sidebar-header {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 72px;
  min-height: 72px;
  padding: 0 1rem;
  flex-shrink: 0;
}
.sidebar .hamburger-btn {
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0;
  color: var(--text-secondary);
  transition: all 0.2s;
}
.sidebar .hamburger-btn .hamburger-line {
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: all 0.3s;
}
.sidebar .hamburger-btn:hover {
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
}
.sidebar .nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 1rem;
  transition: padding 0.3s;
}
.sidebar .nav::-webkit-scrollbar {
  width: 4px;
}
.sidebar .nav::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
.sidebar .nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  margin-bottom: 0.5rem;
  border-radius: 10px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s;
  position: relative;
}
.sidebar .nav-item .nav-icon {
  flex-shrink: 0;
  stroke: currentColor;
}
.sidebar .nav-item .nav-text {
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity 0.3s, max-width 0.3s;
}
.sidebar .nav-item:hover {
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
}
.sidebar .nav-item.active {
  background: rgba(99, 102, 241, 0.15);
  color: #6366f1;
  font-weight: 600;
}
.sidebar .nav-divider {
  height: 1px;
  background: var(--border);
  margin: 1rem 0;
}
.sidebar .user-profile {
  margin-top: auto;
  padding: 1rem 1rem 0;
  padding-bottom: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  transition: padding 0.3s, justify-content 0.3s;
}
.sidebar .user-profile .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #6366f1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  color: white;
  flex-shrink: 0;
  transition: background 0.2s;
}
.sidebar .user-profile .avatar.avatar-mine {
  background: #10b981;
}
.sidebar .user-profile .user-info {
  flex: 1;
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  transition: opacity 0.3s, max-width 0.3s;
}
.sidebar .user-profile .user-info .user-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text);
  white-space: nowrap;
}
.sidebar .user-profile .user-info .user-role {
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
}
.sidebar .user-profile .logout-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: transparent;
  border: none;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.sidebar .user-profile .logout-btn:hover {
  background: var(--bg);
  color: #ef4444;
}
.sidebar .user-profile .logout-btn svg {
  flex-shrink: 0;
}

@media (min-width: 769px) {
  .sidebar ~ .main-content {
    margin-left: 80px;
    width: calc(100% - 80px);
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
}

@media (min-width: 769px) {
  .sidebar.expanded ~ .main-content {
    margin-left: 260px;
    width: calc(100% - 260px);
  }
}

/**
 * Buttons Component
 * Alle Button-Varianten und -Größen
 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.btn .icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
@media (max-width: 480px) {
  .btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
  }
}
.btn.btn-primary {
  background: #6366f1;
  color: white;
}
.btn.btn-primary:hover {
  background: #4f46e5;
  transform: translateY(-1px);
}
.btn.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn.btn-secondary:hover {
  background: var(--surface);
  border-color: #6366f1;
}
.btn.btn-danger {
  background: #ef4444;
  color: white;
}
.btn.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-1px);
}
.btn.btn-success {
  background: #10b981;
  color: white;
}
.btn.btn-success:hover {
  background: #059669;
  transform: translateY(-1px);
}
.btn.btn-full {
  width: 100%;
}
.btn.btn-microsoft {
  background: #2f2f2f;
  color: white;
}
.btn.btn-microsoft:hover {
  transform: translateY(-1px);
}
.btn.btn-sm {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border-radius: 8px;
}
.btn.btn-sm .icon {
  width: 16px;
  height: 16px;
}
.btn.btn-icon {
  padding: 0.5rem;
}
.btn.btn-icon .icon {
  margin: 0;
}
.btn.btn-outline-primary {
  background: transparent;
  color: #6366f1;
  border: 1px solid #6366f1;
}
.btn.btn-outline-primary:hover {
  background: #6366f1;
  color: white;
  transform: translateY(-1px);
}
.btn.btn-outline-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn.btn-outline-secondary:hover {
  background: var(--surface);
  color: var(--text);
  border-color: var(--text-secondary);
}
.btn.btn-outline-danger {
  background: transparent;
  color: #ef4444;
  border: 1px solid #ef4444;
}
.btn.btn-outline-danger:hover {
  background: #ef4444;
  color: white;
  transform: translateY(-1px);
}
.btn.btn-ghost {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.5rem;
}
.btn.btn-ghost:hover {
  background: var(--surface);
  color: var(--text);
}
.btn.btn-ghost.btn-danger {
  color: #ef4444;
  background: transparent;
}
.btn.btn-ghost.btn-danger:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.btn-group {
  display: inline-flex;
  gap: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.btn-group .btn {
  border-radius: 0;
  border: none;
  border-right: 1px solid var(--border);
  margin: 0;
}
.btn-group .btn:last-child {
  border-right: none;
}
.btn-group .btn.active {
  background: #6366f1;
  color: white;
}
.btn-group .btn.active:hover {
  background: #4f46e5;
}
.btn-group .btn:not(.active) {
  background: transparent;
  color: var(--text-secondary);
}
.btn-group .btn:not(.active):hover {
  background: var(--surface);
  color: var(--text);
}
@media (max-width: 768px) {
  .btn-group .btn {
    min-width: 44px;
    padding: 0.625rem;
  }
  .btn-group .btn svg {
    width: 18px;
    height: 18px;
  }
}

.view-toggle .btn {
  display: flex;
  align-items: center;
  justify-content: center;
}

.favorite-btn {
  background: transparent !important;
  color: var(--text-secondary) !important;
  border: 1px solid var(--border) !important;
}
.favorite-btn:hover {
  background: var(--surface) !important;
  border-color: #6366f1 !important;
  color: #6366f1 !important;
}
.favorite-btn[data-is-favorite=true] {
  background: rgba(99, 102, 241, 0.1) !important;
  border-color: #6366f1 !important;
  color: #6366f1 !important;
}
.favorite-btn[data-is-favorite=true]:hover {
  background: rgba(99, 102, 241, 0.15) !important;
  border-color: #4f46e5 !important;
  color: #4f46e5 !important;
}
.favorite-btn .icon {
  color: inherit;
}
.favorite-btn.btn-sm {
  border: 1px solid var(--border) !important;
}
.favorite-btn.btn-sm:hover {
  border-color: #6366f1 !important;
}
.favorite-btn.btn-sm[data-is-favorite=true] {
  border-color: #6366f1 !important;
}

/**
 * Cards Component
 * Alle Card-Varianten, Stats-Grid und Content-Grid
 */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}
.card h2.card-title {
  font-size: 1.125rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}
.card h2.card-title .icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.card .card-header {
  margin-bottom: 1.5rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.card .card-header .card-title {
  margin: 0;
  flex: 1;
}
.card .card-header .view-toggle {
  flex-shrink: 0;
}
.card .card-body {
  padding: 0;
}
.card .card-subheader {
  padding: 0;
  margin-bottom: 1.5rem;
}
.card .card-subheader.card-subheader-full {
  margin-left: -1.5rem;
  margin-right: -1.5rem;
  margin-bottom: 1.5rem;
  padding: 0 1.5rem;
}
@media (max-width: 768px) {
  .card {
    padding: 1rem;
    border-radius: 10px;
  }
  .card h3 {
    font-size: 1.125rem;
    margin-bottom: 1.25rem;
  }
  .card .card-header {
    margin-bottom: 1rem;
  }
  .card .card-subheader {
    margin-bottom: 1rem;
  }
  .card .card-subheader.card-subheader-full {
    margin-left: -1rem;
    margin-right: -1rem;
    margin-bottom: 1rem;
    padding: 0 1rem;
  }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}
@media (max-width: 768px) and (orientation: portrait) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
}
@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
}
.stats-grid .stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.2s ease;
  min-width: 0;
  overflow: hidden;
}
@media (max-width: 768px) {
  .stats-grid .stat-card {
    padding: 1rem;
    border-radius: 8px;
  }
}
.stats-grid .stat-card.stat-card-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  display: block;
}
.stats-grid .stat-card.stat-card-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: #6366f1;
}
.stats-grid .stat-card:hover {
  transform: translateY(-2px);
}
.stats-grid .stat-card .stat-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.stats-grid .stat-card .stat-header .stat-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--background);
}
.stats-grid .stat-card .stat-header .stat-icon .icon-large {
  width: 24px;
  height: 24px;
}
.stats-grid .stat-card .stat-header .stat-icon.stat-icon-yellow {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}
.stats-grid .stat-card .stat-header .stat-icon.stat-icon-blue {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}
.stats-grid .stat-card .stat-header .stat-icon.stat-icon-red {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}
.stats-grid .stat-card .stat-header .stat-icon.stat-icon-green {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}
.stats-grid .stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.stats-grid .stat-card .stat-label {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}
.stats-grid .stat-card .stat-change {
  font-size: 0.875rem;
  font-weight: 600;
}
.stats-grid .stat-card .stat-change.positive {
  color: #10b981;
}
.stats-grid .stat-card .stat-change.negative {
  color: #ef4444;
}
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .stats-grid .stat-card {
    padding: 1rem;
  }
  .stats-grid .stat-card .stat-header .stat-icon {
    font-size: 1.25rem;
  }
  .stats-grid .stat-card .stat-value {
    font-size: 1.5rem;
  }
  .stats-grid .stat-card .stat-label,
  .stats-grid .stat-card .stat-change {
    font-size: 0.8125rem;
  }
}

.content-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
  min-width: 0;
}
@media (max-width: 1024px) {
  .content-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

.content-main {
  min-width: 0;
}

.content-sidebar {
  min-width: 0;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  width: 100%;
}
@media (max-width: 768px) {
  .card-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

.entity-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.2s ease;
  min-width: 0;
  max-width: 100%;
}
@media (max-width: 768px) {
  .entity-card {
    padding: 1rem;
    border-radius: 10px;
  }
}
.entity-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: var(--border-hover);
}
.entity-card .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0;
}
@media (max-width: 768px) {
  .entity-card .card-header {
    flex-direction: row;
    align-items: center;
  }
}
.entity-card .card-header .card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.entity-card .card-header .card-title:hover {
  color: #6366f1;
}
@media (max-width: 768px) {
  .entity-card .card-header .card-title {
    font-size: 1rem;
  }
}
.entity-card .card-header .favorite-btn {
  flex-shrink: 0;
  margin: 0;
}
.entity-card .card-header .favorite-btn[data-is-favorite=true] {
  color: #6366f1;
}
.entity-card .card-header .favorite-btn .icon {
  width: 20px;
  height: 20px;
}
@media (max-width: 768px) {
  .entity-card .card-header .favorite-btn {
    padding: 0.375rem;
  }
  .entity-card .card-header .favorite-btn .icon {
    width: 18px;
    height: 18px;
  }
}
.entity-card .card-body {
  padding: 0;
}
.entity-card .card-body .meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
  min-width: 0;
}
.entity-card .card-body .meta-row:last-child {
  margin-bottom: 0;
}
@media (max-width: 768px) {
  .entity-card .card-body .meta-row {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}
.entity-card .card-body .meta-row .meta-left,
.entity-card .card-body .meta-row .meta-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.entity-card .card-body .meta-row .meta-left {
  flex: 1;
  min-width: 0;
}
.entity-card .card-body .meta-row .meta-right {
  flex-shrink: 0;
}
@media (max-width: 768px) {
  .entity-card .card-body .meta-row .meta-right {
    flex-shrink: 1;
    min-width: 0;
  }
}
.entity-card .card-body .meta-row .meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  white-space: nowrap;
  min-width: 0;
}
@media (max-width: 768px) {
  .entity-card .card-body .meta-row .meta-item {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
.entity-card .card-body .meta-row .meta-item .icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.entity-card .card-body .meta-row .badge {
  font-size: 0.75rem;
  white-space: nowrap;
}
.entity-card .card-body .card-text {
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.entity-card .card-body .card-text.truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.entity-card .card-footer {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.entity-card.is-favorite {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.02);
}
.entity-card.inactive {
  opacity: 0.6;
}

.cost-center-info .cost-center-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--background);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.cost-center-info .cost-center-header .cost-center-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--primary);
}
.cost-center-info .cost-center-header .cost-center-badge .icon {
  width: 18px;
  height: 18px;
}
.cost-center-info .cost-center-header .cost-center-name {
  flex: 1;
  font-weight: 500;
  color: var(--text);
}
.cost-center-info .cost-center-code {
  font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
  font-size: 0.875rem;
  background: var(--background);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--text);
}

.metadata-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.metadata-item {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
@media (min-width: 768px) {
  .metadata-item {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
  }
}
@media (min-width: 768px) {
  .card-body .metadata-list .metadata-item {
    justify-content: flex-start;
    gap: 1rem;
  }
}

.simple-metadata-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.simple-metadata-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
@media (min-width: 768px) {
  .simple-metadata-item {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
  }
}

.simple-metadata-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 120px;
}
@media (max-width: 767px) {
  .simple-metadata-label {
    min-width: auto;
  }
}

.metadata-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 120px;
}
.metadata-label .icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--primary);
}
@media (max-width: 767px) {
  .metadata-label {
    min-width: auto;
  }
}
@media (min-width: 768px) {
  .card-body .metadata-list .metadata-label {
    width: 140px;
    min-width: 140px;
    flex-shrink: 0;
  }
}

.metadata-value {
  font-size: 0.975rem;
  font-weight: 500;
  color: var(--text);
  word-break: break-word;
}
.metadata-value.metadata-value-code {
  font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
  font-size: 0.875rem;
  background: var(--background);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  display: inline-block;
}
.metadata-value .badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
@media (min-width: 768px) {
  .card-body .metadata-list .metadata-value {
    flex: 1;
    text-align: left;
  }
}

.simple-metadata-value {
  font-size: 0.975rem;
  font-weight: 500;
  color: var(--text);
  word-break: break-word;
}

/**
 * Forms Component
 * Alle Form-Elemente: Input, Select, Textarea, Checkbox, Radio
 */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  transition: all 0.2s;
}
.form-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
.form-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}

.select-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
  /* Option A aktiv: Pfeil wird als background-image auf dem Select gerendert. */
  /* Fallback-Pfeil via ::after deaktiviert um Doppelanzeigen zu vermeiden. */
}
.select-wrapper::after {
  display: none;
  content: none;
}
@media (min-width: 769px) {
  .select-wrapper {
    display: inline-block;
  }
}
@media (max-width: 768px) {
  .select-wrapper {
    display: block;
    margin: 0;
    /* Falls ein externes SVG vorhanden ist, am Handy verbergen */
  }
  .select-wrapper .select-icon {
    display: none;
  }
}

.form-select {
  width: 100%;
  /* Extra rechter Innenabstand damit der Pfeil garantiert IM Feld liegt */
  padding: 0.75rem 2.75rem 0.75rem 1rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  transition: all 0.2s;
  line-height: 1.5;
  position: relative; /* Basis für konsistente Höhe & Pseudo-Elemente */
  /* Pfeil als Background (robust auf iOS/Android/Desktop, ohne extra Markup) */
  background-image: linear-gradient(45deg, transparent 50%, var(--text-secondary) 50%), linear-gradient(135deg, var(--text-secondary) 50%, transparent 50%);
  background-position: right 1.2rem center, right 0.9rem center;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
@media (max-width: 768px) {
  .form-select {
    /* Rechts mehr Platz für das Chevron im Mobile-Layout */
    padding: 0.5rem 2.75rem 0.5rem 0.75rem;
    background-position: right 1rem center, right 0.7rem center;
    font-size: 0.875rem;
    line-height: 1.3;
    border-radius: 6px;
  }
}
.form-select:hover {
  border-color: #6366f1;
  background-image: linear-gradient(45deg, transparent 50%, #6366f1 50%), linear-gradient(135deg, #6366f1 50%, transparent 50%);
}
.form-select:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  background-image: linear-gradient(45deg, transparent 50%, #6366f1 50%), linear-gradient(135deg, #6366f1 50%, transparent 50%);
}
.form-select option {
  padding: 0.75rem;
  background: var(--surface);
  color: var(--text);
}

/* SVG-Icon wird für Option A nicht mehr benötigt */
.select-icon {
  display: none;
}

/* alte Hover/Focus-Animation für svg.select-icon entfernt */
.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
@media (max-width: 768px) {
  .form-actions {
    flex-direction: column;
    gap: 0.5rem;
  }
}
.form-actions .btn svg {
  width: 18px;
  height: 18px;
}

.form-row-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}
@media (max-width: 768px) {
  .form-row-grid {
    grid-template-columns: 1fr;
  }
}
.form-row-grid .form-field {
  min-width: 0;
}

.form-help {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.forgot-link {
  color: #6366f1;
  text-decoration: none;
  font-weight: 500;
}
.forgot-link:hover {
  text-decoration: underline;
}

.microsoft-icon {
  flex-shrink: 0;
}

.divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.login-footer {
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.login-footer a {
  color: #6366f1;
  text-decoration: none;
  font-weight: 600;
}
.login-footer a:hover {
  text-decoration: underline;
}

/**
 * Badges Component
 * Einheitliches Badge-System mit semantischen Varianten
 */
.badge, .member-badge, .team-badge, .role-badge, .priority-critical, .priority-high, .priority-normal, .priority-low, .status-done, .status-overdue, .status-progress, .status-open {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.badge-primary, .member-badge.more, .team-badge, .role-badge.role-technician {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #4f46e5;
}

.badge-success, .status-done {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #059669;
}

.badge-warning, .role-badge.role-manager, .priority-high, .status-open {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #d97706;
}

.badge-danger, .role-badge.role-admin, .priority-critical, .status-overdue {
  background: #fee2e2;
  border-color: #fecaca;
  color: #dc2626;
}

.badge-info, .role-badge.role-user, .priority-normal, .status-progress {
  background: #e0f2fe;
  border-color: #bae6fd;
  color: #0284c7;
}

.badge-neutral, .priority-low {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #6b7280;
}

.badge-secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--text-secondary);
}

.badge-sm {
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
}

/* Status Badges - Mapped to semantic variants */
/* Priority Badges - Mapped to semantic variants */
/* Role Badges - Mapped to semantic variants */
/* Team Badge - Uses primary variant */
.team-badge:empty::after {
  content: "-";
  color: #9ca3af;
}

/* Member Badge - Subtle neutral variant */
.member-badge {
  background: var(--background);
  border-color: var(--border);
  color: var(--text);
}
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}
.table thead {
  border-bottom: 2px solid var(--border);
}
.table thead th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background-color 0.2s ease;
}
.table tbody tr:hover {
  background: rgba(139, 92, 246, 0.03);
}
.table tbody tr:last-child {
  border-bottom: none;
}
.table tbody td {
  padding: 0.875rem 1rem;
  font-size: 0.9375rem;
  color: var(--text);
}
.table tbody td.cell-favorite {
  width: 50px;
  padding-right: 0.5rem;
}
.table tbody td.cell-title {
  width: 40%;
  min-width: 250px;
}
.table tbody td a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}
.table tbody td a:hover {
  text-decoration: underline;
}
.table tbody td .text-muted {
  color: var(--text-secondary);
}
.table .badge {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.table .badge.badge-primary {
  background: rgba(139, 92, 246, 0.1);
  color: var(--primary);
}
.table .badge.badge-secondary {
  background: var(--surface-secondary);
  color: var(--text-secondary);
}
.table .badge.badge-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
}
.table .badge.badge-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}
.table .badge.badge-success {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
}

@media (max-width: 768px) {
  .table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .table thead th {
    padding: 0.625rem 0.75rem;
    font-size: 0.8125rem;
  }
  .table tbody td {
    padding: 0.75rem;
    font-size: 0.875rem;
  }
}
/* Pagination
 * Vorher nutzte das Partial Bootstrap-Klassen (.pagination / .page-item / .page-link)
 * ohne dass Bootstrap im Projekt vorhanden ist. Folge: nackte <ul>-Bullets unter dem
 * Page-Size-Selector. Diese Regeln übernehmen den Bootstrap-Kontrakt nativ.
 */
.pagination-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

.page-size-selector {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.page-size-selector .page-size-label {
  white-space: nowrap;
}
.page-size-selector .form-select,
.page-size-selector .form-select-sm {
  width: auto;
  min-width: 5rem;
  padding: 0.35rem 2rem 0.35rem 0.7rem;
  font-size: 0.875rem;
  border-radius: 6px;
}

.pagination {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.pagination.pagination-sm .page-link {
  font-size: 0.8rem;
  padding: 0.35rem 0.7rem;
}
.pagination .page-item {
  list-style: none;
  display: inline-flex;
}
.pagination .page-item.disabled .page-link {
  opacity: 0.4;
  pointer-events: none;
  cursor: default;
}
.pagination .page-item.active .page-link {
  background: var(--primary, #3b82f6);
  color: #fff;
  border-color: var(--primary, #3b82f6);
}
.pagination .page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  padding: 0.4rem 0.7rem;
  color: var(--text-primary);
  background: var(--surface, transparent);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.875rem;
  line-height: 1;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.pagination .page-link:hover {
  background: var(--surface-hover, rgba(255, 255, 255, 0.06));
  border-color: rgba(255, 255, 255, 0.22);
}
.pagination .page-link:focus-visible {
  outline: 2px solid var(--primary, #3b82f6);
  outline-offset: 1px;
}
.pagination .page-link.border-0 {
  border-color: transparent;
  background: transparent;
  cursor: default;
}
.pagination .page-link.border-0:hover {
  background: transparent;
}

/* Bootstrap compat: some views use .mb-0 on the <ul>. Harmless, but keep rhythm consistent. */
.pagination.mb-0 {
  margin-bottom: 0;
}

@media (max-width: 540px) {
  .pagination-wrapper {
    flex-direction: column;
    align-items: stretch;
  }
  .page-size-selector {
    justify-content: space-between;
  }
  .pagination {
    justify-content: center;
  }
}
.kks-fieldset {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in oklab, var(--surface) 92%, transparent);
}
.kks-fieldset__hint {
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.kks-fieldset__hint code {
  background: var(--surface);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  font-family: var(--font-mono, monospace);
  margin-right: 0.15rem;
}
.kks-fieldset__grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
}
@media (max-width: 900px) {
  .kks-fieldset__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 480px) {
  .kks-fieldset__grid {
    grid-template-columns: 1fr;
  }
}
.kks-fieldset .form-group {
  margin: 0;
}
.kks-fieldset .form-input:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.kks-fieldset .kks-level--plant .form-input {
  border-color: rgba(99, 102, 241, 0.5);
}
.kks-fieldset__preview {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  flex-wrap: wrap;
  padding-top: 0.25rem;
  font-size: 0.85rem;
}
.kks-fieldset__preview .kks-preview__label {
  color: var(--text-secondary);
}
.kks-fieldset__preview .kks-preview__value {
  font-family: var(--font-mono, monospace);
  font-weight: 600;
  color: var(--text-primary);
  padding: 0.15rem 0.55rem;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
}
.kks-fieldset__virtual {
  margin-top: 0.25rem;
}
.kks-fieldset__virtual .checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }
}

.show-mobile {
  display: none !important;
}
@media (max-width: 768px) {
  .show-mobile {
    display: initial !important;
  }
}

@media (max-width: 768px) {
  .stack-mobile {
    flex-direction: column !important;
    gap: 0.75rem !important;
  }
}

.fluid-text {
  font-size: clamp(0.9rem, 2.2vw, 1rem);
  line-height: 1.4;
}

@media (max-width: 768px) {
  .task-row {
    padding: 0.75rem 0.75rem;
    gap: 0.75rem;
  }
}

@media (max-width: 768px) {
  .task-title-row {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}

@media (max-width: 768px) {
  .task-meta {
    font-size: 0.75rem;
    line-height: 1.2;
  }
}

@media (max-width: 768px) {
  .favorite-btn {
    width: 36px;
    height: 36px;
    padding: 0.5rem;
  }
}

@media (max-width: 768px) {
  .card {
    border-radius: 16px;
  }
}

@media (max-width: 768px) {
  .card-header {
    padding: 1rem 1rem 0.5rem;
  }
}

@media (max-width: 768px) {
  .card-body {
    padding: 0.5rem 1rem 1rem;
  }
}

@media (max-width: 768px) {
  .filter-bar {
    gap: 0.5rem;
  }
}

@media (max-width: 768px) {
  .filter-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }
}

@media (max-width: 768px) {
  .filter-row {
    flex-wrap: wrap;
  }
}

@media (max-width: 768px) {
  .filter-row-bottom {
    display: none;
  }
  .filter-row-bottom.expanded {
    display: flex;
  }
}

.filter-toggle-btn.active {
  background: rgba(99, 102, 241, 0.15);
}

@media (max-width: 768px) {
  .form-group {
    display: flex;
    flex-direction: column;
  }
}

@media (max-width: 768px) {
  .form-input,
  .form-select,
  textarea {
    font-size: 1rem;
  }
}

@media (max-width: 768px) {
  .bottom-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    max-height: 70vh;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
    padding: 1rem;
    z-index: 5000;
  }
}

@media (max-width: 768px) {
  .bottom-sheet-close {
    position: absolute;
    top: 8px;
    right: 12px;
  }
}

.responsive-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
@media (max-width: 768px) {
  .responsive-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  h1,
  h2,
  h3 {
    line-height: 1.2;
  }
}

@media (max-width: 768px) {
  .sidebar {
    padding-bottom: 4rem;
  }
}

/* Admin Navigation */
.admin-navigation {
  margin-bottom: 2rem;
}

.admin-nav {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--surface);
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  overflow-x: auto;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 0.375rem;
  white-space: nowrap;
  font-weight: 500;
  transition: all 0.2s ease;
  min-width: fit-content;
}
.admin-nav-item:hover {
  color: var(--text);
  background: rgba(99, 102, 241, 0.05);
  text-decoration: none;
}
.admin-nav-item.active {
  color: #6366f1;
  background: rgba(99, 102, 241, 0.1);
  font-weight: 600;
}
.admin-nav-item.active .nav-icon {
  color: #6366f1;
}

/* Mobile Anpassungen */
@media (max-width: 768px) {
  .admin-nav {
    padding: 0.5rem;
    gap: 0.25rem;
  }
  .admin-nav-item {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
  }
}
/**
 * Admin Users List Styles
 */
.user-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

th,
td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td {
  color: var(--text);
}

tr:hover {
  background: rgba(99, 102, 241, 0.05);
}

tr.inactive {
  opacity: 0.6;
}

td.actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* User Info Column */
.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #6366f1;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: 500;
  color: var(--text-primary);
}

.user-username {
  font-size: 0.875rem;
  color: var(--text-tertiary);
}

/* Badges */
.role-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.role-badge.role-admin {
  background: #fee2e2;
  color: #991b1b;
}

.role-badge.role-manager {
  background: #dbeafe;
  color: #1e40af;
}

.role-badge.role-technician {
  background: #d1fae5;
  color: #065f46;
}

.role-badge.role-user {
  background: #e5e7eb;
  color: #374151;
}

.team-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text);
}

.text-muted {
  color: var(--text-secondary);
}

/* Actions */
.btn-group {
  display: flex;
  gap: 0.5rem;
}

.delete-form {
  display: inline;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-tertiary);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state p {
  margin-bottom: 1rem;
}

@media (max-width: 768px) {
  table {
    font-size: 0.875rem;
  }
  th,
  td {
    padding: 0.5rem;
  }
  td.actions {
    flex-direction: column;
  }
  td.actions .btn {
    width: 100%;
  }
}
/**
 * Admin Teams Page Styles
 */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.team-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
}
.team-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.team-card.inactive {
  opacity: 0.6;
}

.team-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.team-info {
  flex: 1;
}

.team-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.5rem 0;
}

.team-actions {
  display: flex;
  gap: 0.5rem;
}
.team-actions .btn {
  padding: 0.5rem 0.75rem;
  min-width: unset;
}

.team-description {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.team-stats {
  display: flex;
  gap: 1.5rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #6366f1;
}

.team-members {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-tertiary);
}
.empty-state svg {
  width: 64px;
  height: 64px;
  margin-bottom: 1rem;
  opacity: 0.5;
}
.empty-state p {
  margin-bottom: 1rem;
}

.team-detail-grid {
  display: grid;
  gap: 1.5rem;
  margin-top: 2rem;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.info-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.info-value {
  font-size: 1rem;
  color: var(--text);
  font-weight: 400;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--surface);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}
.stat-icon svg {
  width: 24px;
  height: 24px;
}

.stat-content {
  flex: 1;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #6366f1;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.75rem;
}

tr.inactive {
  opacity: 0.6;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.setting-item:last-child {
  border-bottom: none;
}

.setting-content h4 {
  margin: 0 0 0.25rem 0;
  font-size: 1rem;
  font-weight: 600;
}
.setting-content p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.info-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.form-actions {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.user-detail-grid {
  display: grid;
  gap: 1.5rem;
  margin-top: 2rem;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.info-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.info-value {
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 400;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--surface);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}
.stat-icon svg {
  width: 24px;
  height: 24px;
}

.stat-content {
  flex: 1;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

/**
 * Admin CheckItem Pool Styles
 */
/* Grid Layout für Checkpoints */
.checkpoints-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

/* Checkpoint Card */
.checkpoint-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  transition: all 0.2s;
}
.checkpoint-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: #6366f1;
}

/* Checkpoint Header */
.checkpoint-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  gap: 1rem;
}

.checkpoint-title {
  flex: 1;
  min-width: 0;
}
.checkpoint-title strong {
  display: block;
  font-size: 1.125rem;
  color: var(--text);
  margin-bottom: 0.5rem;
  line-height: 1.4;
  word-wrap: break-word;
}

/* Checkpoint Actions */
.checkpoint-actions {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}
.checkpoint-actions .btn {
  padding: 0.5rem;
  min-width: auto;
}

/* Checkpoint Description */
.checkpoint-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

/* Checkpoint Meta Information */
.checkpoint-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.checkpoint-meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.checkpoint-meta-item svg {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* Checkpoint Tags */
.checkpoint-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Checklist Styles */
/* Form Styles (konsistent mit anderen Formularen) */
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.form-input,
.form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  transition: all 0.2s;
}
.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
.form-input::placeholder,
.form-select::placeholder {
  color: var(--text-secondary);
}

textarea.form-input {
  resize: vertical;
  min-height: 100px;
}

.form-section {
  margin-bottom: 2rem;
}
.form-section h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

/* Checklist Grid */
.checklist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

/* Checklist Card */
.checklist-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  transition: all 0.2s;
}
.checklist-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: #6366f1;
}
.checklist-card.inactive {
  opacity: 0.6;
}

/* Checklist Header */
.checklist-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  gap: 1rem;
}

.checklist-title {
  flex: 1;
  min-width: 0;
}
.checklist-title strong {
  display: block;
  font-size: 1.125rem;
  color: var(--text);
  margin-bottom: 0.5rem;
  line-height: 1.4;
  word-wrap: break-word;
}

/* Checklist Actions */
.checklist-actions {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}
.checklist-actions .btn {
  padding: 0.5rem;
  min-width: auto;
}

/* Checklist Description */
.checklist-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

/* Checklist Meta Information */
.checklist-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.checklist-meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.checklist-meta-item svg {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* Checklist Tags */
.checklist-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.checklist-info .info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.info-item strong {
  color: var(--text-secondary);
  font-weight: 500;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.tag {
  background: var(--surface);
  color: var(--text-secondary);
  padding: 0.125rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  border: 1px solid var(--border);
}

.check-items-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.check-item {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--surface);
  cursor: pointer;
  transition: all 0.2s ease;
}
.check-item:hover {
  border-color: #6366f1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}
.check-item:hover .check-item-action {
  opacity: 1;
}

.check-item-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.check-item-icon {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
}

.check-item-action {
  margin-left: auto;
  color: var(--text-secondary);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.check-item-title {
  font-weight: 600;
  flex: 1;
}

.check-item-required {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: #ef4444;
  font-size: 0.875rem;
}

.check-item-description {
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.checklist-builder-container {
  margin-top: 2rem;
}

.builder-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
}
@media (max-width: 1024px) {
  .builder-grid {
    grid-template-columns: 1fr;
  }
}

.builder-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  min-height: 600px;
  display: flex;
  flex-direction: column;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.section-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.section-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.search-box {
  position: relative;
}
.search-box svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  width: 18px;
  height: 18px;
}
.search-box input {
  padding-left: 2.5rem;
}

.selected-items-container,
.pool-items-container {
  flex: 1;
  overflow-y: auto;
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 1rem;
  min-height: 300px;
}

.selected-items-container {
  background: rgba(99, 102, 241, 0.02);
}

.section-actions {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.loading-state,
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Item Styles */
.selected-item,
.pool-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: grab;
  transition: all 0.2s ease;
  position: relative;
}
.selected-item:hover,
.pool-item:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transform: translateY(-1px);
}
.selected-item.dragging,
.pool-item.dragging {
  opacity: 0.5;
  border-style: dashed;
}
.selected-item.drag-over-top,
.pool-item.drag-over-top {
  border-top: 2px solid var(--primary);
}
.selected-item.drag-over-bottom,
.pool-item.drag-over-bottom {
  border-bottom: 2px solid var(--primary);
}

.selected-item-content,
.pool-item-content {
  flex: 1;
  min-width: 0; /* Prevent flex overflow */
}

.item-title {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.item-type {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
  background: rgba(var(--text-secondary-rgb), 0.1);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  margin-right: 0.5rem;
}

.item-description {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-required {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--danger);
  font-size: 0.75rem;
  font-weight: 500;
  margin-left: 0.5rem;
}
.item-required::before {
  content: "*";
}

.item-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 1rem;
}

.remove-btn,
.add-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.25rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.remove-btn:hover,
.add-btn:hover {
  background: rgba(var(--danger-rgb), 0.1);
  color: var(--danger);
}

.add-btn:hover {
  background: rgba(var(--primary-rgb), 0.1);
  color: var(--primary);
}

.drag-handle {
  color: var(--text-secondary);
  cursor: grab;
  padding: 0.25rem;
  opacity: 0.5;
}
.drag-handle:hover {
  opacity: 1;
}

/* Pool Specifics */
.pool-item {
  border-left: 3px solid transparent;
}
.pool-item.in-use {
  opacity: 0.6;
  background: var(--bg);
}
.pool-item.in-use .item-title {
  text-decoration: line-through;
}

/* Type Colors */
.item-type-boolean {
  border-left-color: var(--info);
}

.item-type-text {
  border-left-color: var(--text-secondary);
}

.item-type-measurement {
  border-left-color: var(--warning);
}

.item-type-dropdown {
  border-left-color: var(--success);
}

.maintenance-form,
form {
  max-width: 900px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.maintenance-form .card,
form .card {
  margin-bottom: 0;
}
.maintenance-form,
form {
  /* Ensure forms without maintenance-form class also get proper spacing */
}
.maintenance-form > .card:not(:last-child),
form > .card:not(:last-child) {
  margin-bottom: 1.5rem;
}

.form-section {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
.form-section:last-of-type {
  border-bottom: none;
}
.form-section h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.form-group {
  margin-bottom: 1.5rem;
}
.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.form-input,
.form-select {
  width: 100%;
  max-width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--surface);
  color: var(--text);
  transition: all 0.2s;
  font-family: inherit;
  box-sizing: border-box;
}
.form-input:hover,
.form-select:hover {
  border-color: #6366f1;
}
.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

input[type=datetime-local].form-input {
  max-width: 100%;
  min-width: 0;
  width: 100% !important;
}

textarea.form-input {
  resize: vertical;
  min-height: 100px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.form-row .form-group {
  min-width: 0;
}
@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.form-row-equal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.form-row-equal .form-group {
  min-width: 0;
}
@media (max-width: 768px) {
  .form-row-equal {
    grid-template-columns: 1fr;
  }
}

.form-hint {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
@media (max-width: 480px) {
  .form-actions {
    flex-direction: column-reverse;
  }
  .form-actions .btn {
    width: 100%;
  }
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}
.form-checkbox input[type=checkbox] {
  width: 20px;
  height: 20px;
  cursor: pointer;
}
.form-checkbox label {
  cursor: pointer;
  font-weight: 500;
  color: var(--text);
  user-select: none;
}

.error-message {
  font-weight: 500;
  background: rgba(239, 68, 68, 0.1);
  color: rgb(188.842364532, 16.157635468, 16.157635468);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  border-left: 4px solid #dc2626;
}
[data-theme=dark] .error-message {
  background: rgba(220, 38, 38, 0.15);
  color: rgb(247.039408867, 161.960591133, 161.960591133);
  border-left-color: #ef4444;
}

/* Checklisten-Auswahl mit Drag & Drop */
.checklist-controls {
  margin-bottom: 1.5rem;
}

.checklist-search-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
@media (max-width: 768px) {
  .checklist-search-bar {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

.checklist-search-input,
.checklist-tag-filter {
  margin-bottom: 0;
}

.checklist-selection-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 1.5rem;
}
@media (max-width: 1024px) {
  .checklist-selection-wrapper {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

.checklist-section-title {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
}

.checklist-selected-items,
.checklist-available-items {
  display: grid;
  gap: 0.75rem;
  min-height: 200px;
}

.checklist-selected-items {
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 1rem;
}
.checklist-selected-items:empty::before {
  content: "Keine Checklisten ausgewählt";
  display: block;
  text-align: center;
  color: var(--text-secondary);
  padding: 3rem 1rem;
  font-size: 0.875rem;
}

.checklist-item {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  cursor: grab;
}
.checklist-item:hover {
  border-color: #6366f1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.checklist-item.dragging {
  opacity: 0.5;
  cursor: grabbing;
}
.checklist-item:active .checklist-drag-handle {
  cursor: grabbing;
}
@media (max-width: 768px) {
  .checklist-item {
    padding: 0.75rem;
  }
}

.checklist-item-placeholder {
  background: var(--border);
  border: 2px dashed var(--text-secondary);
  border-radius: 8px;
  opacity: 0.5;
}

.checklist-drag-handle {
  flex-shrink: 0;
  color: var(--text-secondary);
  cursor: grab;
  padding: 0.25rem;
  margin-top: 0.125rem;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}
.checklist-drag-handle svg {
  width: 20px;
  height: 20px;
}
@media (max-width: 768px) {
  .checklist-drag-handle svg {
    width: 24px;
    height: 24px;
  }
}
@media (max-width: 768px) {
  .checklist-drag-handle {
    padding: 0.5rem;
    color: var(--text);
  }
}

.checklist-available-items .checklist-item {
  cursor: default;
}
.checklist-available-items .checklist-drag-handle {
  opacity: 0.3;
  cursor: default;
}

.checklist-info {
  flex: 1;
  min-width: 0;
}

.checklist-name {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.checklist-description {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.checklist-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.checklist-add-btn,
.checklist-remove-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 0.125rem;
}
.checklist-add-btn svg,
.checklist-remove-btn svg {
  width: 20px;
  height: 20px;
}
.checklist-add-btn:hover,
.checklist-remove-btn:hover {
  transform: scale(1.05);
}

.checklist-add-btn {
  background: #6366f1;
  color: white;
}
.checklist-add-btn:hover {
  background: #4f46e5;
}

.checklist-remove-btn {
  background: #ef4444;
  color: white;
}
.checklist-remove-btn:hover {
  background: #dc2626;
}

/* Legacy checklist selection (fallback) */
.checklist-selection {
  display: grid;
  gap: 0.75rem;
}

.checklist-label {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  cursor: pointer;
  margin: 0;
}
@media (max-width: 480px) {
  .checklist-label {
    padding: 0.75rem;
  }
}

.checklist-checkbox {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  cursor: pointer;
  accent-color: #6366f1;
}

.empty-state {
  text-align: center;
  padding: 2rem;
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: 8px;
}
.empty-state p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.orders-table {
  overflow-x: auto;
}

.header-inline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}
.header-inline .page-title {
  margin: 0;
}
.header-inline .header-spacer {
  flex: 1 1 auto;
}
.header-inline .header-actions.align-right {
  margin-left: auto;
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}
.header-inline .header-actions.align-right .btn-icon {
  justify-content: center;
}

/* Header-Actions auf gleicher Höhe neben dem Titel */
.page-header .header-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.page-header .header-content .header-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.page-header .header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Einheitlicher Abstand zwischen Icon und Titel in Cards (auch h3) */
.card-header .card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.card-header .card-title .icon {
  width: 20px;
  height: 20px;
}

.table {
  width: 100%;
  border-collapse: collapse;
}
.table th,
.table td {
  padding: 1rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table thead th {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.order-row:hover {
  background: var(--surface);
}

.order-title {
  font-weight: 500;
  color: var(--text);
}

.user-info-compact {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-avatar-xs {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #6366f1;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 600;
}

.object-link {
  color: #6366f1;
  text-decoration: none;
  font-weight: 500;
}
.object-link:hover {
  text-decoration: underline;
}

/* Override Bootstrap styles that conflict with Mainty */
.card {
  border: 1px solid var(--border);
  background-color: var(--surface);
}

.card-header {
  background-color: transparent;
  border-bottom: 1px solid var(--border);
}

.kks-node-header.active {
  background-color: #6366f1 !important;
  color: white !important;
}

/* Override Bootstrap styles that conflict with Mainty */
.modal-content {
  background-color: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.modal-header {
  border-bottom-color: var(--border);
}

.modal-footer {
  border-top-color: var(--border);
}

.btn-close {
  filter: var(--icon-filter, none);
}
[data-theme=dark] .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

.kks-node-header:hover {
  background-color: rgba(99, 102, 241, 0.05);
}

.component-selectable:hover {
  background-color: rgba(99, 102, 241, 0.1);
  color: #6366f1;
}

/* Planning Calendar Styles */
:root {
  --employee-bg: #d1d5d9;
  --employee-header-bg: #c4c8cc;
  --timeline-bg: #fafbfc;
  --timeline-grid: #e9ecef;
  --time-slot-border: #e9ecef;
  --current-time: #ef4444;
  --task-default: #2563eb;
  --task-high: #dc2626;
  --task-medium: #d97706;
  --task-low: #059669;
  --key-bg: #ffffff;
  --key-border: #e3e6ea;
  --key-text: #2c3e50;
  --working-hours-bg: #ffffff;
  --non-working-hours-bg: #f1f5f9;
}

[data-theme=dark] {
  --employee-bg: #2d3748;
  --employee-header-bg: #1e2736;
  --timeline-bg: #0f172a;
  --timeline-grid: #1e293b;
  --time-slot-border: #334155;
  --current-time: #ef4444;
  --task-default: #2563eb;
  --task-high: #dc2626;
  --task-medium: #d97706;
  --task-low: #059669;
  --key-bg: #334155;
  --key-border: #475569;
  --key-text: #f1f5f9;
  --working-hours-bg: #1e293b;
  --non-working-hours-bg: #0f172a;
}

/* Basis Layout - an Objekte-Seite angepasst */
.planning-container {
  display: grid;
  grid-template-rows: 1fr 1fr; /* Strict 50/50 split */
  width: 100%;
  gap: 3rem; /* Increased gap */
  height: calc(100vh - 180px); /* Adjusted for header height */
  overflow: hidden; /* Prevent container scroll */
  padding-bottom: 1rem;
  /* Desktop: Vertical Split 50/50 */
}
@media (min-width: 1024px) {
  .planning-container {
    grid-template-rows: 1fr 1fr;
    align-items: stretch;
    gap: 3rem;
  }
}

.planning-content {
  display: flex;
  flex-direction: column;
  min-height: 0; /* Important for nested flex scrolling */
  position: relative;
  margin-bottom: 0;
  overflow: hidden; /* Ensure content stays inside */
}

/* Timeline Container (formerly calendar-wrapper) */
.timeline-container {
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid var(--border);
  overflow: hidden; /* Restore overflow hidden for rounded corners */
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
  display: flex;
  flex-direction: column;
  flex: 1; /* Fill available space in planning-content */
  min-height: 0; /* Allow shrinking */
  position: relative; /* For the gradient overlay */
  /* Soft edge on the right to indicate scrolling */
}
.timeline-container::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 40px;
  background: linear-gradient(to right, transparent, var(--surface));
  pointer-events: none;
  z-index: 25; /* Above content but below sticky header if possible, or adjust */
}

/* Unplanned Tasks Panel - Bottom Half */
.unplanned-tasks-panel {
  width: 100%; /* Full width */
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none; /* Remove top border as we use shadow/gap */
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08); /* Softer shadow */
  margin-top: 0;
  z-index: 10;
  overflow: hidden;
}

.panel-header {
  padding: 1.25rem 1.5rem; /* Match card header padding */
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.panel-header h3 {
  margin: 0;
  font-size: 1.125rem; /* Match card title size */
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
}
.panel-header h3 .icon {
  color: var(--primary); /* Add color to icon */
}

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem; /* Reduced padding */
  background: var(--bg); /* Slightly different bg for contrast */
  border-radius: 0 0 16px 16px;
}

.unplanned-tasks-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); /* Smaller cards */
  gap: 0.75rem; /* Reduced gap */
  padding-bottom: 1rem;
}

/* Expand Button Styling */
.expand-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.6rem;
  margin-right: 0.5rem;
  transition: all 0.2s ease;
}
.expand-btn:hover {
  background: var(--bg);
  color: var(--primary);
  border-color: var(--primary);
  transform: scale(1.1);
}
.expand-btn.expanded {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  border-color: var(--primary);
  transform: rotate(0deg); /* Icon is already down arrow */
}

/* Footer Hints Styling */
.timeline-footer-hints {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.hint-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hint-separator {
  width: 1px;
  height: 16px;
  background: var(--border);
  margin: 0 0.5rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.status-dot.status-offen {
  background-color: var(--task-default);
}
.status-dot.status-in_bearbeitung {
  background-color: var(--task-medium);
}
.status-dot.status-abgeschlossen {
  background-color: var(--task-low);
}

/* View Controls & Nav Buttons Polish */
.nav-button {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  height: 36px;
  min-width: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
}
.nav-button:hover {
  background: var(--bg);
  border-color: var(--text-secondary);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.nav-button:active {
  transform: translateY(0);
}

.current-period {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  padding: 0 1rem;
  min-width: 180px;
  text-align: center;
}

/* Header Layout Adjustments */
.planning-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
  background: transparent;
  padding: 0;
  border: none;
}
.planning-header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.planning-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  flex-wrap: wrap;
  gap: 1rem;
}

.planning-description {
  color: var(--text-secondary);
  margin: 0;
  font-size: 1rem;
}

.planning-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  background: var(--surface);
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.date-navigation {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg);
  padding: 0.25rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.current-date {
  font-weight: 600;
  min-width: 140px;
  text-align: center;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.view-controls {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

.btn-group {
  display: flex;
  background: var(--bg);
  padding: 0.25rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  gap: 0.25rem;
}

.btn-group .btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.875rem;
}

.btn-group .btn:hover {
  background: var(--surface);
  color: var(--text);
}

.btn-group .btn.active {
  background: var(--surface);
  color: #6366f1;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Timeline Container (formerly calendar-wrapper) */
.timeline-container {
  background: var(--surface);
  border-radius: 16px; /* More rounded */
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025); /* Deeper shadow */
  display: flex;
  flex-direction: column;
  height: calc(100vh - 280px);
  min-height: 600px;
}

/* Timeline Header Wrapper (formerly calendar-header) */
.timeline-header-wrapper {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg); /* Changed from surface to bg for contrast */
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 4px 6px -4px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
}

/* Timeline Corner (formerly employee-column-header) */
.timeline-corner {
  width: 220px; /* Match employee-info width */
  min-width: 220px;
  padding: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-right: 1px solid var(--border);
  background: var(--bg); /* Match header wrapper */
  display: flex;
  align-items: center;
  position: sticky;
  left: 0;
  z-index: 40; /* Increased z-index */
  /* Ensure corner stays on top of scrolling content */
  box-shadow: 4px 0 6px -4px rgba(0, 0, 0, 0.1);
}

/* Timeline Header (formerly time-scale) */
.timeline-header {
  display: flex;
  flex: 1;
  overflow: hidden; /* Important for Scroll-Sync */
  background: var(--bg); /* Ensure background matches */
}

/* Time Slots Container */
#timeSlots {
  display: grid;
  width: 100%;
  /* grid-template-columns set by JS */
}

/* Time Slot Header Item */
.time-slot {
  /* Used for both header items and grid cells in body */
  flex: 1;
  min-width: 60px;
  border-right: 1px solid var(--border); /* Default border */
  position: relative;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Header specific styles if needed, but usually shared */
}
.time-slot.header-slot {
  padding: 0.75rem 0.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 600; /* Bolder */
  background: var(--bg); /* Match header wrapper */
  border-right: 1px solid transparent; /* Remove default border */
}
.time-slot.header-slot.full-hour {
  border-right: 1px solid var(--border); /* Only show border for full hours */
}
.time-slot.full-hour {
  border-right: 1px solid var(--border);
  background-color: rgba(0, 0, 0, 0.02); /* Subtle highlight for full hours */
}
.time-slot.quarter-hour {
  border-right: 1px solid rgba(0, 0, 0, 0.03); /* Very subtle for quarters */
}

[data-theme=dark] .time-slot.full-hour {
  background-color: rgba(255, 255, 255, 0.02);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme=dark] .time-slot.quarter-hour {
  border-right: 1px solid rgba(255, 255, 255, 0.03);
}

/* Specific style for the hour text in header */
.time-slot-hour {
  padding: 0.75rem 0.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 600; /* Bolder */
}

/* Timeline Body (formerly calendar-body) */
.timeline-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  position: relative;
  background: var(--timeline-bg);
  /* Custom Scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.timeline-body::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.timeline-body::-webkit-scrollbar-track {
  background: transparent;
}

.timeline-body::-webkit-scrollbar-thumb {
  background-color: var(--border);
  border-radius: 4px;
}

.employee-row {
  display: flex;
  border-bottom: 1px solid var(--border);
  min-height: 100px; /* Increased from 80px */
  transition: background-color 0.15s ease;
  position: relative;
  width: max-content; /* Force row to be as wide as content, triggering scroll on parent */
  min-width: 100%;
  /* Zebra Striping */
}
.employee-row:nth-child(even) {
  background-color: rgba(0, 0, 0, 0.01);
}
.employee-row:hover {
  background-color: rgba(0, 0, 0, 0.02); /* Very subtle hover effect */
  z-index: 5; /* Bring to front on hover */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); /* Lift effect */
}
.employee-row:hover .employee-info {
  background-color: var(--surface); /* Match surface */
  box-shadow: 4px 0 8px -4px rgba(0, 0, 0, 0.1);
}

[data-theme=dark] .employee-row:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.01);
}

[data-theme=dark] .employee-row:hover {
  background-color: rgba(255, 255, 255, 0.03);
}
[data-theme=dark] .employee-row:hover .employee-info {
  background-color: var(--surface);
}

.employee-info {
  width: 200px;
  min-width: 200px;
  padding: 1rem;
  border-right: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: sticky; /* Standard sticky */
  left: 0;
  z-index: 100; /* Very high z-index */
  transition: background-color 0.15s ease;
  box-shadow: 4px 0 6px -4px rgba(0, 0, 0, 0.1); /* Stronger shadow */
}

.employee-name {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.employee-role {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.employee-timeline {
  display: grid;
  flex: 1;
  position: relative;
  background: var(--timeline-bg);
  /* Grid columns are set via inline styles in JS */
  /* Vertical Hour Lines - More visible */
  background-image: linear-gradient(to right, transparent calc(100% - 1px), var(--border) calc(100% - 1px));
  background-size: 4.1666666667% 100%; /* Assuming 24 hours */
  /* Optional: Sub-grid for quarters (very subtle) */
}
.employee-timeline::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: linear-gradient(to right, transparent calc(100% - 1px), rgba(0, 0, 0, 0.03) calc(100% - 1px));
  background-size: 1.0416666667% 100%; /* 96 quarters */
  pointer-events: none;
  z-index: 0;
}

[data-theme=dark] .employee-timeline::before {
  background-image: linear-gradient(to right, transparent calc(100% - 1px), rgba(255, 255, 255, 0.02) calc(100% - 1px));
}

/* Current Time Line */
.current-time-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: var(--current-time);
  z-index: 25;
  pointer-events: none;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}
.current-time-line::after {
  content: "";
  position: absolute;
  top: -4px;
  left: -4px;
  width: 10px;
  height: 10px;
  background-color: var(--current-time);
  border-radius: 50%;
  box-shadow: 0 0 4px rgba(239, 68, 68, 0.4);
}

/* Past Overlay */
.past-overlay {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.03);
  pointer-events: none;
  z-index: 1;
  border-right: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme=dark] .past-overlay {
  background-color: rgba(255, 255, 255, 0.02);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

/* Drag Preview (Shadow on Timeline) */
.drag-preview {
  position: absolute;
  top: 0;
  bottom: 0;
  background-color: rgba(59, 130, 246, 0.15); /* Primary color with opacity */
  border: 2px dashed var(--task-default);
  border-radius: 6px;
  pointer-events: none;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--task-default);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  /* overflow: hidden;  <-- Removed to allow text to be seen if box is small */
  backdrop-filter: blur(2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  /* Ensure text is readable even if box is small */
}
.drag-preview::after {
  content: attr(data-time);
  position: absolute;
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--task-default);
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 25;
  pointer-events: none;
}

/* Timeline Header (formerly time-scale) */
.timeline-header {
  display: flex;
  flex: 1;
  overflow: hidden; /* Important for Scroll-Sync */
  background: var(--surface); /* Ensure background matches */
}

/* Time Slots Container */
#timeSlots {
  display: grid;
  width: 100%;
  /* grid-template-columns set by JS */
}

/* Time Slot Header Item */
.time-slot {
  /* Used for both header items and grid cells in body */
  flex: 1;
  min-width: 60px;
  border-right: 1px solid var(--border); /* Default border */
  position: relative;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Header specific styles if needed, but usually shared */
}
.time-slot.header-slot {
  padding: 0.75rem 0.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
  background: var(--surface);
}
.time-slot.full-hour {
  border-right: 1px solid var(--border);
  background-color: rgba(0, 0, 0, 0.02); /* Subtle highlight for full hours */
}
.time-slot.quarter-hour {
  border-right: 1px solid rgba(0, 0, 0, 0.03); /* Very subtle for quarters */
}

[data-theme=dark] .time-slot.full-hour {
  background-color: rgba(255, 255, 255, 0.02);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme=dark] .time-slot.quarter-hour {
  border-right: 1px solid rgba(255, 255, 255, 0.03);
}

/* Specific style for the hour text in header */
.time-slot-hour {
  padding: 0.75rem 0.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 600; /* Bolder */
}

/* Timeline Body (formerly calendar-body) */
.timeline-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  position: relative;
  background: var(--timeline-bg);
  /* Custom Scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.timeline-body::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.timeline-body::-webkit-scrollbar-track {
  background: transparent;
}

.timeline-body::-webkit-scrollbar-thumb {
  background-color: var(--border);
  border-radius: 4px;
}

.employee-row {
  display: flex;
  border-bottom: 1px solid var(--border);
  min-height: 80px;
  transition: background-color 0.15s ease;
  position: relative;
  /* Zebra Striping */
}
.employee-row:nth-child(even) {
  background-color: rgba(0, 0, 0, 0.01);
}
.employee-row:hover {
  background-color: rgba(0, 0, 0, 0.02); /* Very subtle hover effect */
  z-index: 5; /* Bring to front on hover */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); /* Lift effect */
}
.employee-row:hover .employee-info {
  background-color: var(--surface); /* Match surface */
  box-shadow: 4px 0 8px -4px rgba(0, 0, 0, 0.1);
}

[data-theme=dark] .employee-row:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.01);
}

[data-theme=dark] .employee-row:hover {
  background-color: rgba(255, 255, 255, 0.03);
}
[data-theme=dark] .employee-row:hover .employee-info {
  background-color: var(--surface);
}

.employee-info {
  width: 220px; /* Slightly wider */
  min-width: 220px;
  padding: 1rem;
  border-right: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* Align top */
  gap: 1rem;
  position: sticky;
  left: 0;
  z-index: 10;
  transition: background-color 0.15s ease;
  box-shadow: 4px 0 6px -4px rgba(0, 0, 0, 0.05);
}

.employee-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.employee-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.employee-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.employee-name {
  font-weight: 600;
  color: var(--text);
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.employee-role {
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.expand-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
  padding: 0;
}
.expand-btn:hover {
  background: var(--bg);
  color: var(--text);
}
.expand-btn svg {
  transition: transform 0.2s;
}
.expand-btn.expanded svg {
  transform: rotate(180deg);
}

.employee-stats {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.utilization-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.utilization-value {
  font-weight: 600;
  color: var(--text);
}

.utilization-bar {
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
  width: 100%;
}

.utilization-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease, background-color 0.3s ease;
}
.utilization-fill.utilization-low {
  background-color: var(--task-high); /* Red */
}
.utilization-fill.utilization-medium {
  background-color: var(--task-medium); /* Orange */
}
.utilization-fill.utilization-optimal {
  background-color: var(--task-low); /* Green */
}
.utilization-fill.utilization-high {
  background-color: var(--task-high); /* Red */
}

.utilization-hours {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-align: right;
}

.employee-timeline {
  display: grid;
  flex: 1;
  position: relative;
  background: var(--timeline-bg);
  /* Grid columns are set via inline styles in JS */
  /* Vertical Hour Lines - More visible */
  background-image: linear-gradient(to right, transparent calc(100% - 1px), var(--border) calc(100% - 1px));
  background-size: 4.1666666667% 100%; /* Assuming 24 hours */
  /* Optional: Sub-grid for quarters (very subtle) */
}
.employee-timeline::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: linear-gradient(to right, transparent calc(100% - 1px), rgba(0, 0, 0, 0.03) calc(100% - 1px));
  background-size: 1.0416666667% 100%; /* 96 quarters */
  pointer-events: none;
  z-index: 0;
}

[data-theme=dark] .employee-timeline::before {
  background-image: linear-gradient(to right, transparent calc(100% - 1px), rgba(255, 255, 255, 0.02) calc(100% - 1px));
}

/* Current Time Line */
.current-time-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: var(--current-time);
  z-index: 25;
  pointer-events: none;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}
.current-time-line::after {
  content: "";
  position: absolute;
  top: -4px;
  left: -4px;
  width: 10px;
  height: 10px;
  background-color: var(--current-time);
  border-radius: 50%;
  box-shadow: 0 0 4px rgba(239, 68, 68, 0.4);
}

/* Past Overlay */
.past-overlay {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.03);
  pointer-events: none;
  z-index: 1;
  border-right: 1px solid rgba(0, 0, 0, 0.05);
}

[data-theme=dark] .past-overlay {
  background-color: rgba(255, 255, 255, 0.02);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

/* Drag Preview (Shadow on Timeline) */
.drag-preview {
  position: absolute;
  top: 0;
  bottom: 0;
  background-color: rgba(59, 130, 246, 0.15); /* Primary color with opacity */
  border: 2px dashed var(--task-default);
  border-radius: 6px;
  pointer-events: none;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--task-default);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  backdrop-filter: blur(2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Dragula Mirror (Drag Shadow) */
.gu-mirror {
  position: fixed !important;
  margin: 0 !important;
  z-index: 9999 !important;
  opacity: 0.9;
  transform: rotate(2deg) scale(1.02);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.25), 0 5px 10px rgba(0, 0, 0, 0.1);
  pointer-events: none;
  background: var(--task-default);
  border-radius: 6px;
  padding: 0.5rem;
  color: white;
  font-size: 0.875rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  /* Keep original dimensions if possible, or set reasonable defaults */
  min-width: 150px;
}
.gu-mirror .task-title {
  font-weight: 600;
  margin-bottom: 2px;
}
.gu-mirror .task-time {
  font-size: 0.75rem;
  opacity: 0.9;
}

.gu-hide {
  display: none !important;
}

.gu-unselectable {
  user-select: none !important;
}

.gu-transit {
  opacity: 0.3;
  filter: grayscale(50%);
}

.time-slot:hover {
  background-color: rgba(99, 102, 241, 0.02);
}

.time-slot.non-working-hours {
  background-color: var(--non-working-hours-bg);
  background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(0, 0, 0, 0.02) 10px, rgba(0, 0, 0, 0.02) 20px);
}

[data-theme=dark] .time-slot.non-working-hours {
  background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255, 255, 255, 0.02) 10px, rgba(255, 255, 255, 0.02) 20px);
}

/* Tasks */
.task-item {
  position: absolute;
  top: 6px; /* More breathing room */
  bottom: 6px;
  background: var(--task-default);
  border-radius: 6px; /* Cleaner radius */
  padding: 0.25rem 0.5rem;
  color: white;
  font-size: 0.875rem;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease-out;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Flatter shadow */
  z-index: 5;
  border: none;
  border-left: 3px solid rgba(255, 255, 255, 0.4); /* Cleaner accent */
  display: flex;
  flex-direction: row; /* Content left, actions right */
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  /* Subtle gradient for depth without looking "glossy" */
  background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.05));
}

.task-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  z-index: 15;
  border-left-color: rgba(255, 255, 255, 0.8);
}

.task-content-wrapper {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
  min-width: 0; /* Allow flex child to shrink below content size */
}

.task-title {
  font-weight: 600;
  font-size: 0.8125rem; /* 13px */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0;
  line-height: 1.2;
  text-shadow: none; /* Remove heavy shadow */
}

.task-time {
  font-size: 0.7rem; /* 11px */
  opacity: 0.9;
  white-space: nowrap;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  margin-top: 1px;
}

.task-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.task-assign-btn,
.task-info-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.8);
  padding: 4px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.task-assign-btn:hover,
.task-info-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
}
.task-assign-btn svg,
.task-info-btn svg {
  width: 14px;
  height: 14px;
}

/* Priority Colors - Flat & Clean */
.task-item.priority-high {
  background-color: var(--task-high);
  box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
}

.task-item.priority-medium {
  background-color: var(--task-medium);
  box-shadow: 0 2px 4px rgba(217, 119, 6, 0.2);
}

.task-item.priority-low {
  background-color: var(--task-low);
  box-shadow: 0 2px 4px rgba(5, 150, 105, 0.2);
}

/* Status Colors - Override Priority */
.task-item.status-ueberfaellig,
.task-item.status-überfällig {
  background-color: var(--task-high); /* Red */
  box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
  border-left-color: rgba(255, 255, 255, 0.6);
}

.task-item.status-in_bearbeitung {
  background-color: var(--task-medium); /* Orange */
  box-shadow: 0 2px 4px rgba(217, 119, 6, 0.2);
}

.task-item.status-abgeschlossen {
  background-color: var(--task-low); /* Green */
  box-shadow: 0 2px 4px rgba(5, 150, 105, 0.2);
  opacity: 0.9;
}

/* Resize Handles */
.task-resize-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 10px;
  cursor: col-resize;
  z-index: 20;
  opacity: 0; /* Invisible but clickable */
  transition: opacity 0.2s;
}
.task-resize-handle:hover {
  opacity: 1;
  background-color: rgba(255, 255, 255, 0.3);
}
.task-resize-handle.left {
  left: 0;
}
.task-resize-handle.right {
  right: 0;
}

.task-item:hover .task-resize-handle {
  /* Optional: make them visible on hover of task */
  /* opacity: 0.5; */
}

/* Current Time Indicator */
.current-time-indicator {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--current-time);
  z-index: 20;
  pointer-events: none;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6); /* Glow effect */
}

.current-time-indicator::before {
  content: "";
  position: absolute;
  top: -5px;
  left: -5px;
  width: 12px;
  height: 12px;
  background: var(--current-time);
  border-radius: 50%;
  box-shadow: 0 0 4px rgba(239, 68, 68, 0.4);
  border: 2px solid var(--surface); /* Cutout effect */
}

/* Loading State */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  backdrop-filter: blur(2px);
}

[data-theme=dark] .loading-overlay {
  background: rgba(15, 23, 42, 0.8);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
/* Drag & Drop Styles */
.task-item.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.time-slot.drag-over {
  background-color: rgba(99, 102, 241, 0.1);
}

/* Keyboard Shortcuts Legend */
.shortcuts-legend {
  display: flex;
  gap: 1.5rem;
  padding: 1rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.shortcut-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.key {
  background: var(--key-bg);
  border: 1px solid var(--key-border);
  border-radius: 4px;
  padding: 0.125rem 0.375rem;
  font-family: monospace;
  font-size: 0.75rem;
  color: var(--key-text);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .planning-header-top {
    flex-direction: column;
    align-items: flex-start;
  }
  .planning-controls {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
  .date-navigation {
    justify-content: space-between;
  }
  .view-controls {
    margin-left: 0;
    justify-content: center;
  }
  .timeline-corner,
  .employee-info {
    width: 120px;
    min-width: 120px;
    padding: 0.5rem;
  }
  .employee-role {
    display: none;
  }
}
.past-overlay {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.04); /* Leicht abgedunkelt */
  pointer-events: none;
  z-index: 1; /* Über dem Hintergrund, unter dem Grid-Inhalt */
  border-right: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme=dark] .past-overlay {
  background-color: rgba(255, 255, 255, 0.03); /* Leicht aufgehellt im Dark Mode */
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

/* Missing Styles for Planning Calendar */
.day-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--border);
  padding: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  min-height: 40px;
}

.day-name {
  font-weight: 600;
  color: var(--text);
}

.day-date {
  font-size: 0.75rem;
}

/* Planning View Wrapper to scope header styles */
.planning-view-wrapper .page-header {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.planning-view-wrapper .page-header-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
@media (min-width: 1024px) {
  .planning-view-wrapper .page-header-main {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}
.planning-view-wrapper .page-header-content {
  display: flex;
  align-items: center;
}
.planning-view-wrapper .page-header-content h1 {
  margin: 0;
  white-space: nowrap;
}
.planning-view-wrapper .page-header-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}
@media (min-width: 768px) {
  .planning-view-wrapper .page-header-actions {
    flex-direction: row;
    align-items: center;
    width: auto;
  }
}
.planning-view-wrapper .planning-legend-row {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
}

.planning-legend-container {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.9rem;
  color: var(--text);
  flex-wrap: wrap;
}
.planning-legend-container .legend-label {
  font-weight: 600;
  color: var(--text);
  margin-right: 0.5rem;
}
.planning-legend-container .legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}
.planning-legend-container .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.planning-legend-container .status-dot.status-offen {
  background-color: var(--task-default);
}
.planning-legend-container .status-dot.status-in_bearbeitung {
  background-color: var(--task-medium);
}
.planning-legend-container .status-dot.status-abgeschlossen {
  background-color: var(--task-low);
}

/* Panel Controls - Fixed Layout */
.panel-controls {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  width: 100%;
  margin-top: 1rem;
}
.panel-controls input[type=search] {
  flex: 2; /* Search takes more space */
  min-width: 150px;
}
.panel-controls select {
  flex: 1;
  min-width: 120px;
}
.panel-controls {
  /* Ensure inputs have proper height and styling */
}
.panel-controls .form-control,
.panel-controls .form-select {
  height: 38px; /* Slightly taller */
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  border-radius: 8px; /* Match standard inputs */
  border: 1px solid var(--border);
  background-color: var(--bg);
  color: var(--text);
}
.panel-controls .form-control:focus,
.panel-controls .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.unplanned-tasks-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); /* Slightly wider cards */
  gap: 1rem; /* More breathing room */
  padding-bottom: 1rem;
}

.unplanned-task {
  background: var(--surface);
  border: 1px solid transparent; /* Cleaner look */
  border-left: 4px solid var(--task-default); /* Thicker accent */
  border-radius: 8px; /* Softer corners */
  padding: 0.75rem 1rem; /* More padding */
  cursor: grab;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04); /* Subtle shadow */
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.unplanned-task:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08); /* Elevated hover */
  z-index: 2;
}
.unplanned-task.dragging {
  opacity: 0.5;
  cursor: grabbing;
  transform: scale(1.02);
}
.unplanned-task h4 {
  margin: 0;
  font-size: 0.9rem; /* Readable title */
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  /* Allow 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
}
.unplanned-task p {
  display: none;
}
.unplanned-task .task-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}
.unplanned-task .task-meta span {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}
.unplanned-task .task-meta svg {
  width: 12px;
  height: 12px;
  opacity: 0.8;
}

.task-count {
  background: var(--primary);
  color: white;
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  font-size: 0.75rem;
  margin-left: auto;
}

.loading-state {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* Team Filter Styles */
.employee-row {
  transition: opacity 0.3s ease, filter 0.3s ease;
}
.employee-row.filtered-out {
  opacity: 0.15;
  pointer-events: none;
  filter: grayscale(100%);
}

body.team-filter-active .employee-row:not(.filtered-out) {
  background-color: rgba(37, 99, 235, 0.05); /* var(--primary) with opacity */
}
[data-theme=dark] body.team-filter-active .employee-row:not(.filtered-out) {
  background-color: rgba(37, 99, 235, 0.1);
}

/* Planning Modal Styles */
.detail-content {
  padding: 0.5rem;
}

.grid-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}
@media (max-width: 768px) {
  .grid-layout {
    grid-template-columns: 1fr;
  }
}

.info-group {
  margin-bottom: 1rem;
}
.info-group label {
  display: block;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.description {
  white-space: pre-wrap;
}

.card {
  background: var(--surface);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}

.card-header h4 {
  margin: 0 0 0.5rem 0;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.time-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}
.time-row .label {
  color: var(--text-secondary);
}

.assigned-user,
.assigned-team {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.assigned-dispatcher {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
  padding-top: 0.5rem;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.object-section,
.checklists-section,
.documents-section {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.object-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  background: var(--bg);
  padding: 1rem;
  border-radius: 6px;
  margin-top: 0.5rem;
}

.detail-item {
  display: flex;
  flex-direction: column;
}
.detail-item .label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.checklists-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.checklist-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: var(--bg);
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* Error Page Styles */
.error-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
  padding: 2rem;
}

.error-content {
  text-align: center;
  max-width: 600px;
}

.error-icon {
  margin-bottom: 2rem;
}
.error-icon svg {
  width: 80px;
  height: 80px;
  color: #ef4444;
}

.error-title {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--text);
}

.error-message {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* KKS Tree Styles - Modern Design */
:root {
  --kks-plant-color: #6366f1;
  --kks-system-color: #0ea5e9;
  --kks-subsystem-color: #f59e0b;
  --kks-component-color: #8b5cf6;
  --kks-linked-color: #10b981;
  --kks-primary: #6366f1;
  --kks-primary-rgb: 99, 102, 241;
}

[data-theme=dark] {
  --kks-primary: #818cf8;
  --kks-primary-rgb: 129, 140, 248;
}

/* Force body background to match theme, overriding Bootstrap if necessary */
[data-theme=dark] body {
  background-color: var(--bg) !important;
  color: var(--text) !important;
}

.kks-tree-container {
  max-height: 600px;
  overflow-y: auto;
  padding: 0;
  background: transparent;
  /* Scrollbar Styling */
}
.kks-tree-container::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.kks-tree-container::-webkit-scrollbar-track {
  background: var(--surface);
  border-radius: 4px;
}
.kks-tree-container::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.3);
  border-radius: 4px;
}
.kks-tree-container::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.5);
}
[data-theme=dark] .kks-tree-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}
[data-theme=dark] .kks-tree-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
}
[data-theme=dark] .kks-tree-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.kks-tree {
  list-style: none;
  padding-left: 0;
  margin: 0;
}
.kks-tree ul {
  list-style: none;
  padding-left: 2rem;
  margin: 0.5rem 0;
  position: relative;
}
.kks-tree ul::before {
  content: "";
  position: absolute;
  left: 1rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
  opacity: 0.2;
  z-index: 0;
}

.kks-node {
  position: relative;
}
.kks-node::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.5rem;
  width: 1rem;
  height: 2px;
  background: var(--border);
  z-index: 1;
}

.kks-node-junction {
  position: absolute;
  left: 0;
  top: 1.5rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border);
  transform: translate(-50%, -50%);
  z-index: 2;
}

/* Colorize lines based on node type */
/* Systems (children of Plant) */
.kks-plant > ul::before {
  background: var(--kks-plant-color);
  opacity: 0.2;
}
.kks-plant > ul > .kks-node::before {
  background: var(--kks-system-color);
  opacity: 0.3;
}
.kks-plant > ul > .kks-node .kks-node-junction {
  border-color: var(--kks-system-color);
}

/* Subsystems (children of System) */
.kks-system > ul::before {
  background: var(--kks-system-color);
  opacity: 0.2;
}
.kks-system > ul > .kks-node::before {
  background: var(--kks-subsystem-color);
  opacity: 0.3;
}
.kks-system > ul > .kks-node .kks-node-junction {
  border-color: var(--kks-subsystem-color);
}

/* Components (children of Subsystem) */
.kks-subsystem > ul::before {
  background: var(--kks-subsystem-color);
  opacity: 0.2;
}
.kks-subsystem > ul > .kks-node::before {
  background: var(--kks-component-color);
  opacity: 0.3;
}
.kks-subsystem > ul > .kks-node .kks-node-junction {
  border-color: var(--kks-component-color);
}

.kks-node-header {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  gap: 0.75rem;
  background: var(--bg);
  border: 1px solid transparent;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
[data-theme=dark] .kks-node-header {
  background: rgba(255, 255, 255, 0.03);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.kks-node-header:hover {
  background: var(--surface);
  border-color: rgba(99, 102, 241, 0.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}
[data-theme=dark] .kks-node-header:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}
.kks-node-header:hover .kks-icon {
  transform: scale(1.1);
}
.kks-node-header:hover .btn-link {
  opacity: 1;
}
.kks-node-header.drag-over {
  background: rgba(16, 185, 129, 0.1) !important;
  border: 2px dashed var(--kks-linked-color) !important;
  transform: scale(1.02);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}
.kks-node-header .btn-link {
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  padding: 0.375rem 0.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 4px;
}
.kks-node-header .btn-link:hover {
  color: var(--kks-primary);
  background: rgba(99, 102, 241, 0.1);
  transform: scale(1.05);
}
.kks-node-header .btn-link i {
  font-size: 1rem;
}

.kks-toggle {
  width: 18px;
  height: 18px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kks-node.expanded > .kks-node-header .kks-toggle {
  transform: rotate(90deg);
}

.kks-icon {
  font-size: 1.25rem;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.kks-code {
  font-weight: 700;
  font-family: "Monaco", "Courier New", monospace;
  font-size: 0.875rem;
  min-width: 80px;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--kks-primary);
  letter-spacing: 0.5px;
}

.kks-name {
  flex: 1;
  color: var(--text);
  font-weight: 500;
  font-size: 0.9375rem;
}

.badge {
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  font-size: 0.75rem;
}

/* Ebenen-spezifische Farben */
.kks-plant .kks-node-header {
  border-left: 3px solid var(--kks-plant-color);
}
.kks-plant .kks-icon {
  color: var(--kks-plant-color);
}
.kks-plant .kks-code {
  background: rgba(99, 102, 241, 0.15);
  color: var(--kks-plant-color);
}

.kks-system .kks-node-header {
  border-left: 3px solid var(--kks-system-color);
}
.kks-system .kks-icon {
  color: var(--kks-system-color);
}
.kks-system .kks-code {
  background: rgba(14, 165, 233, 0.15);
  color: var(--kks-system-color);
}

.kks-subsystem .kks-node-header {
  border-left: 3px solid var(--kks-subsystem-color);
}
.kks-subsystem .kks-icon {
  color: var(--kks-subsystem-color);
}
.kks-subsystem .kks-code {
  background: rgba(245, 158, 11, 0.15);
  color: var(--kks-subsystem-color);
}

.kks-component .kks-node-header {
  border-left: 3px solid var(--kks-component-color);
}
.kks-component .kks-icon {
  color: var(--kks-component-color);
}
.kks-component .kks-code {
  background: rgba(139, 92, 246, 0.15);
  color: var(--kks-component-color);
}
.kks-component.linked .kks-node-header {
  border-left-color: var(--kks-linked-color);
  background: rgba(16, 185, 129, 0.05);
}
.kks-component.linked .kks-icon {
  color: var(--kks-linked-color);
}
.kks-component.linked .kks-code {
  background: rgba(16, 185, 129, 0.15);
  color: var(--kks-linked-color);
}

/* Kinder standardmäßig versteckt */
.kks-children {
  display: none;
  margin-top: 0.5rem;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.kks-node.expanded > .kks-children {
  display: block;
}

/* Details Panel */
#detailsPanel {
  min-height: 200px;
  padding: 1rem;
}
#detailsPanel .alert {
  border-radius: 8px;
  border-left-width: 3px;
}

.alert {
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  border-radius: 0.375rem;
  font-size: 0.875rem;
}

.alert-success {
  color: #0f5132;
  background-color: #d1e7dd;
  border-color: #badbcc;
}

.alert-secondary {
  color: #41464b;
  background-color: #e2e3e5;
  border-color: #d3d6d8;
}

/* Unlinked Objects */
#unlinkedObjects .card {
  border: 1px solid var(--border);
  border-left: 3px solid var(--kks-subsystem-color);
  border-radius: 6px;
  margin-bottom: 0.5rem;
  transition: all 0.2s ease;
  background: var(--bg);
}
[data-theme=dark] #unlinkedObjects .card {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
}
#unlinkedObjects .card:hover {
  border-left-color: var(--kks-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateX(4px);
}
#unlinkedObjects .fw-bold {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}
#unlinkedObjects .text-muted {
  font-size: 0.875rem;
}
#unlinkedObjects .btn-outline-primary {
  border-radius: 6px;
  font-size: 0.875rem;
  padding: 0.375rem 0.75rem;
  transition: all 0.2s ease;
}
#unlinkedObjects .btn-outline-primary:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* Card Styling */
.card {
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  background: var(--bg);
}
[data-theme=dark] .card {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.card-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.25rem;
  border-radius: 12px 12px 0 0 !important;
}
[data-theme=dark] .card-header {
  background: rgba(255, 255, 255, 0.02);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.card-title {
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
}

.card-body {
  padding: 1.25rem;
}

/* Responsive */
@media (max-width: 768px) {
  .kks-tree ul {
    padding-left: 1.25rem;
  }
  .kks-tree ul::before {
    left: 0.5rem;
  }
  .kks-node::before {
    left: -0.75rem;
    width: 0.75rem;
  }
  .kks-node-header {
    padding: 0.625rem 0.875rem;
    gap: 0.5rem;
  }
  .kks-code {
    min-width: 60px;
    font-size: 0.8125rem;
    padding: 0.2rem 0.4rem;
  }
  .kks-name {
    font-size: 0.875rem;
  }
  .kks-icon {
    font-size: 1.125rem;
    width: 20px;
    height: 20px;
  }
  .badge {
    font-size: 0.6875rem;
    padding: 0.25rem 0.5rem;
  }
}
/* =========================================
   MINDMAP VIEW STYLES
   ========================================= */
.mindmap-view.kks-tree-container {
  overflow-x: auto;
  overflow-y: auto;
  padding: 2rem;
  background: var(--bg);
  white-space: nowrap;
}
.mindmap-view.kks-tree-container .kks-tree {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  width: max-content;
  padding-bottom: 2rem;
  /* Reset default tree styles */
}
.mindmap-view.kks-tree-container .kks-tree ul {
  padding-left: 0;
  margin: 0;
  position: relative;
}
.mindmap-view.kks-tree-container .kks-tree ul::before {
  display: none;
}
.mindmap-view.kks-tree-container .kks-node {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0.5rem 0;
}
.mindmap-view.kks-tree-container .kks-node::before {
  display: none;
}
.mindmap-view.kks-tree-container .kks-node-junction {
  display: none;
}
.mindmap-view.kks-tree-container .kks-node-header {
  min-width: 220px;
  max-width: 220px;
  margin-right: 3rem; /* Space for connector */
  position: relative;
  z-index: 2;
  white-space: normal; /* Allow text wrap inside card */
  /* Line from Parent to Children Group */
}
.mindmap-view.kks-tree-container .kks-node-header::after {
  content: "";
  position: absolute;
  right: -3rem;
  top: 50%;
  width: 3rem;
  height: 2px;
  background: var(--border);
  display: none;
}
.mindmap-view.kks-tree-container {
  /* Show connector only if node has children and is expanded */
}
.mindmap-view.kks-tree-container .kks-node.expanded > .kks-node-header::after {
  display: block;
}
.mindmap-view.kks-tree-container .kks-children {
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  margin-top: 0;
  animation: none;
  border-left: 2px solid var(--border);
  /* Line from Children Group Border to Child Node */
}
.mindmap-view.kks-tree-container .kks-children > .kks-node {
  padding-left: 2rem;
  position: relative;
}
.mindmap-view.kks-tree-container .kks-children > .kks-node::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 2rem;
  height: 2px;
  background: var(--border);
  display: block;
}
.mindmap-view.kks-tree-container {
  /* Adjust colors for connectors based on level */
}
.mindmap-view.kks-tree-container .kks-plant > .kks-children {
  border-left-color: var(--kks-plant-color);
}
.mindmap-view.kks-tree-container .kks-plant > .kks-children > .kks-node::before {
  background: var(--kks-plant-color);
}
.mindmap-view.kks-tree-container .kks-plant > .kks-node-header::after {
  background: var(--kks-plant-color);
}
.mindmap-view.kks-tree-container .kks-system > .kks-children {
  border-left-color: var(--kks-system-color);
}
.mindmap-view.kks-tree-container .kks-system > .kks-children > .kks-node::before {
  background: var(--kks-system-color);
}
.mindmap-view.kks-tree-container .kks-system > .kks-node-header::after {
  background: var(--kks-system-color);
}
.mindmap-view.kks-tree-container .kks-subsystem > .kks-children {
  border-left-color: var(--kks-subsystem-color);
}
.mindmap-view.kks-tree-container .kks-subsystem > .kks-children > .kks-node::before {
  background: var(--kks-subsystem-color);
}
.mindmap-view.kks-tree-container .kks-subsystem > .kks-node-header::after {
  background: var(--kks-subsystem-color);
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  backdrop-filter: blur(2px);
}
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  background: var(--bg);
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: transform 0.3s ease;
  overflow: hidden;
}
.modal-overlay.active .modal-container {
  transform: scale(1);
}
[data-theme=dark] .modal-container {
  background: var(--bg);
  border: 1px solid var(--border);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
}
[data-theme=dark] .modal-header {
  background: var(--surface);
  border-color: var(--border);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}
[data-theme=dark] .modal-title {
  color: var(--text);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text);
}
[data-theme=dark] .modal-close {
  color: var(--text-secondary);
}
[data-theme=dark] .modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: var(--surface);
}
.modal-footer:empty {
  display: none;
}
[data-theme=dark] .modal-footer {
  background: var(--surface);
  border-color: var(--border);
}

/* Loading State */
.modal-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: var(--text-secondary);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(99, 102, 241, 0.1);
  border-radius: 50%;
  border-top-color: #6366f1;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
/* Custom Confirm Dialog Styles */
.confirm-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.confirm-modal.active {
  opacity: 1;
}

.confirm-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.confirm-dialog {
  position: relative;
  background: var(--surface);
  border-radius: 16px;
  padding: 2rem;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
  transform: scale(0.9) translateY(-20px);
  transition: transform 0.2s ease;
  z-index: 1;
}
.confirm-modal.active .confirm-dialog {
  transform: scale(1) translateY(0);
}

.confirm-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.confirm-icon-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.confirm-icon-warning {
  background: rgba(251, 191, 36, 0.1);
  color: #fbbf24;
}

.confirm-icon-info {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.confirm-title {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.confirm-message {
  text-align: center;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 2rem;
  font-size: 1rem;
}

.confirm-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.confirm-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  font-family: inherit;
}
.confirm-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
}

.confirm-btn-cancel {
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--border);
}
.confirm-btn-cancel:hover {
  background: var(--bg);
  border-color: var(--text-secondary);
}

.confirm-btn-confirm {
  color: white;
}

.confirm-btn-danger {
  background: #dc2626;
}
.confirm-btn-danger:hover {
  background: #b91c1c;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(220, 38, 38, 0.3);
}

.confirm-btn-warning {
  background: #f59e0b;
}
.confirm-btn-warning:hover {
  background: #d97706;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.3);
}

.confirm-btn-info {
  background: #3b82f6;
}
.confirm-btn-info:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
}

/* Mobile Optimierung */
@media (max-width: 768px) {
  .confirm-dialog {
    padding: 1.5rem;
    max-width: 90%;
  }
  .confirm-title {
    font-size: 1.25rem;
  }
  .confirm-message {
    font-size: 0.875rem;
  }
  .confirm-actions {
    flex-direction: column-reverse;
  }
  .confirm-btn {
    width: 100%;
  }
}
/**
 * Toast Notifications CSS
 * Moderne Benachrichtigungen mit Animationen
 */
/* Container für alle Toasts */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}
@media (max-width: 768px) {
  .toast-container {
    top: 10px;
    right: 10px;
    left: 10px;
  }
}

/* Einzelner Toast */
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 320px;
  max-width: 450px;
  padding: 16px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-left: 4px solid;
  pointer-events: auto;
  position: relative;
  /* Initial State (versteckt) */
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
@media (max-width: 768px) {
  .toast {
    min-width: auto;
    max-width: none;
  }
}
[data-theme=dark] .toast {
  background: var(--surface);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.toast {
  /* Accessibility */
}
.toast:focus-within {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}
.toast {
  /* Progress Bar (optional - für Auto-Dismiss Visualisierung) */
}
.toast::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: currentColor;
  opacity: 0.2;
  border-radius: 0 0 8px 8px;
}

/* Slide-in Animation */
.toast.toast-show {
  opacity: 1;
  transform: translateX(0);
}

/* Slide-out Animation */
.toast.toast-hide {
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.3s ease-in;
}

/* Toast Icon */
.toast-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.toast-icon svg {
  width: 100%;
  height: 100%;
}

/* Toast Message */
.toast-message {
  flex: 1;
  font-size: 14px;
  line-height: 1.5;
  color: #333;
  word-break: break-word;
}
[data-theme=dark] .toast-message {
  color: var(--text);
}

/* Close Button */
.toast-close {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #999;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.toast-close:hover {
  color: #333;
}
.toast-close svg {
  width: 100%;
  height: 100%;
}
[data-theme=dark] .toast-close {
  color: var(--text-secondary);
}
[data-theme=dark] .toast-close:hover {
  color: var(--text);
}

/* Toast Varianten */
/* Success Toast */
.toast-success {
  border-left-color: #22c55e;
  color: #22c55e;
}
.toast-success .toast-icon {
  color: #22c55e;
}

/* Error Toast */
.toast-error {
  border-left-color: #ef4444;
  color: #ef4444;
}
.toast-error .toast-icon {
  color: #ef4444;
}

/* Warning Toast */
.toast-warning {
  border-left-color: #f59e0b;
  color: #f59e0b;
}
.toast-warning .toast-icon {
  color: #f59e0b;
}

/* Info Toast */
.toast-info {
  border-left-color: #3b82f6;
  color: #3b82f6;
}
.toast-info .toast-icon {
  color: #3b82f6;
}

/**
 * Loading States Styles
 * Spinner, Overlays und Skeleton-Loading
 */
/* ==================== SPINNER KOMPONENTEN ==================== */
/* Kleiner Spinner für Buttons */
.spinner-small {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

/* Großer Spinner für Overlays */
.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(99, 102, 241, 0.2);
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
/* ==================== BUTTON LOADING STATES ==================== */
.btn-loading {
  position: relative;
  cursor: not-allowed;
  opacity: 0.7;
}
.btn-loading:disabled {
  pointer-events: none;
}

/* Dark Spinner für helle Buttons */
.btn-secondary .spinner-small,
.btn-ghost .spinner-small {
  border-color: rgba(0, 0, 0, 0.2);
  border-top-color: var(--text);
}

/* ==================== GLOBAL LOADING OVERLAY ==================== */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.loading-overlay.active {
  opacity: 1;
  visibility: visible;
}

.loading-spinner {
  background: var(--surface);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.loading-text {
  margin: 0;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
}

/* ==================== INLINE LOADING ==================== */
.loading-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  justify-content: center;
}
.loading-inline .spinner-small {
  border-color: rgba(128, 128, 128, 0.3);
  border-top-color: var(--text-secondary);
}

/* ==================== SKELETON LOADING ==================== */
.loading-skeleton {
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}
.skeleton-item {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.skeleton-line {
  height: 16px;
  background: linear-gradient(90deg, var(--surface) 25%, var(--border) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  margin-bottom: 8px;
}

.skeleton-title {
  width: 60%;
  height: 20px;
  margin-bottom: 12px;
}

.skeleton-text {
  width: 100%;
}
.skeleton-text:last-child {
  width: 80%;
  margin-bottom: 0;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
/* ==================== DISABLED STATES ==================== */
.btn:disabled,
.btn[disabled] {
  cursor: not-allowed;
  opacity: 0.6;
  pointer-events: none;
}

input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  background-color: var(--surface);
}

/* ==================== LOADING STATES FÜR CARDS ==================== */
.card.loading {
  position: relative;
  pointer-events: none;
}
.card.loading::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(1px);
  display: flex;
  align-items: center;
  justify-content: center;
}
[data-theme=dark] .card.loading::after {
  background: rgba(0, 0, 0, 0.5);
}

/* ==================== PROGRESS INDICATOR ==================== */
.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--surface);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
.progress-bar::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: #6366f1;
  animation: progress-slide 1.5s ease-in-out infinite;
}

@keyframes progress-slide {
  0% {
    left: -50%;
  }
  100% {
    left: 100%;
  }
}
/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  .loading-spinner {
    padding: 1.5rem;
  }
  .spinner {
    width: 40px;
    height: 40px;
    border-width: 3px;
  }
  .loading-text {
    font-size: 0.85rem;
  }
}
/* ==================== ANIMATIONS ==================== */
/* Favoriten Pulse Animation */
.favorite-pulse {
  animation: favorite-pulse 0.3s ease;
}

@keyframes favorite-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}
/* Success Flash für Buttons */
.btn-success-flash {
  animation: success-flash 0.5s ease;
}

@keyframes success-flash {
  0%, 100% {
    background-color: #6366f1;
  }
  50% {
    background-color: #22c55e;
  }
}
/* Multi-Select Component */
.multi-select-wrapper {
  position: relative;
  width: 100%;
}

.multi-select-trigger {
  min-height: 42px; /* Match standard input height */
  padding: 4px 8px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: text;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}
.multi-select-trigger:hover {
  border-color: #6366f1;
}
.multi-select-trigger.active {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.multi-select-tag {
  background: rgba(99, 102, 241, 0.15);
  color: #6366f1;
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.875rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.multi-select-tag-remove {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  transition: background 0.2s;
  opacity: 0.7;
}
.multi-select-tag-remove:hover {
  background: rgba(99, 102, 241, 0.2);
  opacity: 1;
}
.multi-select-tag-remove::before {
  content: "×";
  font-size: 14px;
  line-height: 1;
  font-weight: bold;
}

.multi-select-input {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.95rem;
  padding: 4px;
  flex: 1;
  min-width: 60px;
  outline: none;
}

.multi-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  max-height: 250px;
  overflow-y: auto;
  display: none;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.2s, transform 0.2s;
}
.multi-select-dropdown.open {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.multi-select-option {
  padding: 8px 12px;
  cursor: pointer;
  color: var(--text);
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.multi-select-option:hover, .multi-select-option.highlighted {
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
}
.multi-select-option.selected {
  background: rgba(99, 102, 241, 0.05);
  color: var(--text-secondary);
  opacity: 0.7;
}
.multi-select-option.selected::after {
  content: "✓";
  color: #6366f1;
  font-weight: bold;
}

.multi-select-empty {
  padding: 12px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Data Table Styles */
:root {
  --primary-light: #e0e7ff;
}

[data-theme=dark] {
  --primary-light: rgba(99, 102, 241, 0.2);
}

.data-table-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1rem;
}

.data-table th {
  position: relative;
  vertical-align: middle;
  white-space: nowrap;
}

.th-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.sort-link {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  flex-grow: 1;
  cursor: pointer;
}
.sort-link:hover {
  color: #6366f1;
}

.sort-icon {
  display: inline-flex;
  opacity: 0.3;
  transition: opacity 0.2s;
}
.sort-link:hover .sort-icon, .sort-link.sorted-asc .sort-icon, .sort-link.sorted-desc .sort-icon {
  opacity: 1;
}

.filter-trigger {
  opacity: 0.4;
  padding: 2px;
  height: 24px;
  width: 24px;
  min-width: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
  color: var(--text-secondary);
}
.filter-trigger:hover {
  opacity: 1;
  color: #6366f1;
  background-color: var(--surface);
}
.filter-trigger.active {
  opacity: 1;
  background-color: #6366f1;
  color: #ffffff;
}

/* Popover */
.filter-popover {
  position: absolute;
  z-index: 1000;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  padding: 1rem;
  width: 280px;
  display: none;
  animation: fadeIn 0.2s ease-out;
}
.filter-popover.visible {
  display: block;
}
[data-theme=dark] .filter-popover {
  background-color: var(--surface);
  border-color: var(--border);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.filter-popover-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.filter-popover-body {
  margin-bottom: 1rem;
}

.filter-popover-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.btn-close-popover {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 1.2rem;
  line-height: 1;
  padding: 0;
}
.btn-close-popover:hover {
  color: var(--text);
}

/* Searchable Select Styles */
.filter-search-input {
  margin-bottom: 0.5rem;
}

.filter-options-list {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
}
[data-theme=dark] .filter-options-list {
  background: var(--bg);
}

.filter-option-item {
  padding: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background-color 0.1s;
}
.filter-option-item:hover {
  background-color: var(--surface);
}
.filter-option-item.selected {
  background-color: var(--primary-light);
  color: #6366f1;
}
[data-theme=dark] .filter-option-item.selected {
  background-color: rgba(99, 102, 241, 0.2);
}

.filter-option-check {
  width: 16px;
  height: 16px;
  border: 1px solid var(--text-secondary);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.filter-option-item.selected .filter-option-check {
  background-color: #6366f1;
  border-color: #6366f1;
  color: white;
}
.filter-option-item.selected .filter-option-check::after {
  display: block;
}
.filter-option-check::after {
  content: "✓";
  font-size: 12px;
  display: none;
}

:root,
[data-theme=dark] {
  --bg: #0f0f1a;
  --surface: #1a1a2e;
  --border: #2d2d44;
  --text: #e5e7eb;
  --text-secondary: #9ca3af;
}

[data-theme=light] {
  --bg: #ffffff;
  --surface: #f8f9fa;
  --border: #e5e7eb;
  --text: #1f2937;
  --text-secondary: #6b7280;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

a {
  color: inherit;
  text-decoration: none;
}
a:hover {
  text-decoration: none;
}

html {
  overflow-x: hidden;
  overflow-y: auto;
  height: 100%;
  scroll-behavior: smooth;
}
@media (max-width: 768px) {
  html {
    overflow-x: hidden;
    overflow-y: auto;
    height: 100%;
  }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 0.9375rem;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  width: 100%;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1100;
  height: 72px;
  min-height: 72px;
  gap: 1rem;
  width: 100%;
}
@media (max-width: 768px) {
  .top-bar {
    padding: 0.75rem;
    height: 60px;
    min-height: 60px;
    gap: 0.75rem;
  }
}
.top-bar .mobile-hamburger {
  display: none;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0;
  color: var(--text);
  transition: all 0.2s;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
@media (max-width: 768px) {
  .top-bar .mobile-hamburger {
    display: flex;
  }
}
.top-bar .mobile-hamburger .line {
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: all 0.3s;
}
.top-bar .mobile-hamburger:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: #6366f1;
  color: #6366f1;
}
.top-bar .mobile-hamburger:active {
  transform: scale(0.95);
}

.app-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 1;
  flex-grow: 1;
  min-width: 0;
  position: relative;
  z-index: 2;
  overflow: visible;
}
@media (max-width: 768px) {
  .app-logo {
    gap: 0.5rem;
    font-size: 1.125rem;
    flex-shrink: 1;
    flex-grow: 1;
    min-width: 120px;
    margin: 0;
    padding: 0;
  }
}
.app-logo .logo-icon {
  color: #6366f1;
  stroke: #6366f1;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: block;
}
@media (max-width: 768px) {
  .app-logo .logo-icon {
    width: 22px;
    height: 22px;
  }
}
.app-logo .logo-text {
  white-space: nowrap;
  overflow: visible;
  display: inline-block;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.theme-toggle {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
@media (max-width: 768px) {
  .theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }
}
.theme-toggle svg {
  position: absolute;
  stroke: currentColor;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
@media (max-width: 768px) {
  .theme-toggle svg {
    width: 18px;
    height: 18px;
  }
}
.theme-toggle .sun-icon {
  opacity: 0;
  transform: rotate(90deg) scale(0.3);
}
.theme-toggle .moon-icon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}
.theme-toggle:hover {
  background: var(--bg);
  border-color: #6366f1;
  color: #6366f1;
}
.theme-toggle:active {
  transform: scale(0.95);
}

[data-theme=light] .theme-toggle .sun-icon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}
[data-theme=light] .theme-toggle .moon-icon {
  opacity: 0;
  transform: rotate(-90deg) scale(0.3);
}

.app-container {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

.content-wrapper {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
@media (max-width: 768px) {
  .content-wrapper {
    padding: 1rem;
    padding-bottom: 2rem;
  }
}
.content-wrapper > * {
  max-width: 100%;
  min-width: 0;
}

@keyframes pulse-subtle {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }
  50% {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  }
}
@keyframes bounce-in {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
  }
  60% {
    opacity: 1;
    transform: scale(1.05) translateY(-5px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}
@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
  }
}

.dashboard-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
}
.dashboard-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.6s ease;
  pointer-events: none;
}
@media (max-width: 768px) {
  .dashboard-card {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
    padding: 1rem;
    min-height: 120px;
    justify-content: center;
  }
}
.dashboard-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  text-decoration: none;
  color: var(--text);
}
.dashboard-card:hover::before {
  left: 100%;
}
.dashboard-card:hover .dashboard-card-icon {
  transform: scale(1.1) rotate(5deg);
}
.dashboard-card:hover .dashboard-card-value {
  transform: scale(1.05);
}
.dashboard-card:active {
  transform: translateY(-2px) scale(1.01);
  transition-duration: 0.1s;
}
.dashboard-card.card-highlight {
  animation: pulse-subtle 2s ease-in-out infinite;
}
.dashboard-card.bounce-in {
  animation: bounce-in 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.dashboard-card:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.3);
}
.dashboard-card.card-primary {
  border-color: rgba(99, 102, 241, 0.3);
}
.dashboard-card.card-primary .dashboard-card-icon {
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
}
.dashboard-card.card-primary:hover {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.02);
}
.dashboard-card.card-warning {
  border-color: rgba(245, 158, 11, 0.3);
}
.dashboard-card.card-warning .dashboard-card-icon {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}
.dashboard-card.card-warning:hover {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.02);
}
.dashboard-card.card-success {
  border-color: rgba(16, 185, 129, 0.3);
}
.dashboard-card.card-success .dashboard-card-icon {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}
.dashboard-card.card-success:hover {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.02);
}
.dashboard-card.card-info {
  border-color: rgba(6, 182, 212, 0.3);
}
.dashboard-card.card-info .dashboard-card-icon {
  background: rgba(6, 182, 212, 0.1);
  color: #06b6d4;
}
.dashboard-card.card-info:hover {
  border-color: #06b6d4;
  background: rgba(6, 182, 212, 0.02);
}
@media (max-width: 768px) {
  .dashboard-card {
    padding: 1rem;
    gap: 0.75rem;
  }
}

.dashboard-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  flex-shrink: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.dashboard-card-icon svg {
  width: 24px;
  height: 24px;
  transition: inherit;
}
@media (max-width: 768px) {
  .dashboard-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
  }
  .dashboard-card-icon svg {
    width: 20px;
    height: 20px;
  }
}

.dashboard-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
@media (max-width: 768px) {
  .dashboard-card-content {
    flex: none;
    text-align: center;
  }
}

.dashboard-card-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@media (max-width: 768px) {
  .dashboard-card-value {
    font-size: 1.5rem;
  }
}

.dashboard-card-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
  line-height: 1.3;
}
@media (max-width: 768px) {
  .dashboard-card-label {
    font-size: 0.8rem;
  }
}
@media (max-width: 768px) {
  .dashboard-card-label {
    font-size: 0.8125rem;
  }
}

.dashboard-tasks {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.task-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background 0.2s;
}
.task-row:hover {
  background: rgba(99, 102, 241, 0.05);
  text-decoration: none;
  color: inherit;
}
.task-row:last-child {
  border-bottom: none;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
@media (max-width: 768px) {
  .page-header {
    margin-bottom: 1.5rem;
    flex-direction: column;
    gap: 1rem;
  }
}
.page-header .page-header-content {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
}
@media (max-width: 768px) {
  .page-header .page-header-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}
.page-header .page-header-content .btn-icon {
  flex-shrink: 0;
}
.page-header .page-header-content h1 {
  margin: 0;
}
.page-header .page-header-content p {
  margin: 0.25rem 0 0;
  color: var(--text-secondary);
}
@media (max-width: 768px) {
  .page-header .page-header-content p {
    margin: 0;
  }
}
.page-header .page-header-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-shrink: 0;
  flex-wrap: wrap;
}
@media (max-width: 768px) {
  .page-header .page-header-actions {
    width: 100%;
    gap: 0.5rem;
  }
  .page-header .page-header-actions .btn {
    flex: 1;
    min-width: 0;
  }
  .page-header .page-header-actions .btn span {
    display: none;
  }
  .page-header .page-header-actions .btn.btn-sm {
    padding: 0.5rem;
    justify-content: center;
  }
  .page-header .page-header-actions .favorite-btn span {
    display: inline;
  }
}
@media (max-width: 480px) {
  .page-header .page-header-actions .btn span {
    display: none;
  }
  .page-header .page-header-actions .btn {
    padding: 0.5rem;
  }
}
.page-header .header-content.header-inline {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}
@media (max-width: 768px) {
  .page-header .header-content.header-inline {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}
.page-header .header-content.header-inline .page-title {
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
  flex-shrink: 0;
}
@media (max-width: 768px) {
  .page-header .header-content.header-inline .page-title {
    font-size: 1.5rem;
  }
}
.page-header .header-content.header-inline .badge {
  flex-shrink: 0;
}
.page-header .header-spacer {
  flex: 1;
}
.page-header .header-actions.align-right {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
}
@media (max-width: 768px) {
  .page-header .header-actions.align-right {
    width: 100%;
    justify-content: flex-end;
  }
  .page-header .header-actions.align-right .btn-icon {
    min-width: 44px;
    height: 44px;
    padding: 0.625rem;
    justify-content: center;
  }
}
.page-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}
@media (max-width: 768px) {
  .page-header h1 {
    font-size: 1.5rem;
  }
}
.page-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0;
  line-height: 1.5;
}
@media (max-width: 768px) {
  .page-header p {
    font-size: 0.875rem;
  }
}

.task-list {
  margin: -1.5rem;
  padding: 0;
}
.task-list .task-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}
.task-list .task-item:hover {
  background: rgba(99, 102, 241, 0.05);
}
.task-list .task-item:last-child {
  border-bottom: none;
}
.task-list .task-item .task-content {
  flex: 1;
}
.task-list .task-item .task-content .task-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.task-list .task-item .task-content .task-meta {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.timeline .timeline-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.timeline .timeline-item:last-child {
  border-bottom: none;
}
.timeline .timeline-item .timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #6366f1;
  margin-top: 0.5rem;
  flex-shrink: 0;
}
.timeline .timeline-item .timeline-content {
  flex: 1;
}
.timeline .timeline-item .timeline-content .timeline-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.timeline .timeline-item .timeline-content .timeline-time {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.login-container {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  overflow-y: auto;
}
@media (max-width: 640px) {
  .login-container {
    padding: 1rem;
  }
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}
@media (max-width: 640px) {
  .login-card {
    max-width: 100%;
    border-radius: 12px;
  }
}

.login-header {
  padding: 2rem 2rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
@media (max-width: 640px) {
  .login-header {
    padding: 1.5rem 1.25rem 1rem;
  }
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-placeholder {
  color: #6366f1;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}
@media (max-width: 640px) {
  .logo-text {
    font-size: 1.25rem;
  }
}

.login-body {
  padding: 2rem;
}
@media (max-width: 640px) {
  .login-body {
    padding: 1.25rem;
  }
}

.login-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}
@media (max-width: 640px) {
  .login-title {
    font-size: 1.5rem;
  }
}

.login-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin: 0 0 2rem;
}

.error-messages {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 10px;
}
.error-messages .error-message {
  color: #ef4444;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}
.error-messages .error-message:last-child {
  margin-bottom: 0;
}

.field-error {
  color: #ef4444;
  font-size: 0.75rem;
  margin-top: 0.25rem;
  font-weight: 500;
}

.input-error {
  border-color: #ef4444 !important;
}
.input-error:focus {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.task-item .task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}
.task-item .meta-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  min-width: 0;
  overflow: hidden;
}
.task-item .meta-item span,
.task-item .meta-item a,
.task-item .meta-item text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.task-item .meta-item svg {
  flex-shrink: 0;
}
.task-item .avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #6366f1;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  transition: background 0.2s;
}
.task-item .avatar.avatar-mine {
  background: #10b981;
}

.task-item-compact {
  display: block;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background-color 0.2s;
}
.task-item-compact:hover {
  background: var(--background);
}
.task-item-compact:last-child {
  border-bottom: none;
}

.task-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.task-main {
  flex: 1;
  min-width: 0;
}

.task-info {
  flex: 1;
  min-width: 0;
}

.task-title-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.125rem;
}
.task-title-row .favorite-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 1.2rem;
  min-width: 1.2rem;
  padding: 0.1rem;
  border: none;
  background: none;
  color: var(--text-secondary);
  border-radius: 0.25rem;
  transition: all 0.2s ease;
  align-self: baseline;
}
.task-title-row .favorite-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.task-title-row .favorite-btn .icon {
  width: 0.875rem;
  height: 0.875rem;
}

.task-check {
  color: #10b981;
  font-weight: bold;
  font-size: 1rem;
}

.task-title {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  display: flex;
  align-items: baseline;
}

.task-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.task-meta {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 0.125rem;
  flex-wrap: wrap;
  line-height: 1.2;
}
.task-meta svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  vertical-align: baseline;
}
.task-meta span {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
  line-height: 1.2;
}

.task-progress {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.task-progress .progress-bar-container {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.task-progress .progress-bar-container .progress-bar {
  height: 100%;
  background: var(--text-secondary);
  border-radius: 3px;
  transition: width 0.3s ease, background-color 0.3s ease;
}
.task-progress .progress-bar-container .progress-bar.progress-active {
  background: #6366f1;
}
.task-progress .progress-bar-container .progress-bar.progress-complete {
  background: #10b981;
}
.task-progress .progress-text {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 40px;
  text-align: right;
}

.task-date,
.task-team {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  white-space: nowrap;
}
.task-date .icon,
.task-team .icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.task-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.task-badges .avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #6366f1;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  transition: background 0.2s;
}
.task-badges .avatar.avatar-mine {
  background: #10b981;
}

@media (max-width: 768px) {
  .task-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .task-badges {
    width: 100%;
    flex-wrap: wrap;
  }
  .task-info {
    flex-wrap: wrap;
  }
}
.filter-bar {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin-bottom: 0;
}

.filter-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.filter-form.collapsed .filter-row-bottom {
  display: none;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.filter-row.filter-row-main {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: nowrap;
}
.filter-row.filter-row-main .filter-toggle-btn {
  flex-shrink: 0;
  min-width: 44px;
  height: 44px;
}
.filter-row.filter-row-main .filter-search {
  flex: 1;
  min-width: 150px;
}
.filter-row.filter-row-main .view-toggle {
  flex-shrink: 0;
  white-space: nowrap;
}
.filter-row.filter-row-bottom {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  width: 100%;
}
.filter-row.filter-row-bottom .btn {
  grid-column: -1;
  justify-self: end;
}

.filter-toggle-btn {
  white-space: nowrap;
  position: relative;
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-secondary) !important;
}
.filter-toggle-btn:not(.active):hover {
  background: var(--surface-secondary) !important;
  color: var(--text) !important;
}
.filter-toggle-btn.active {
  border: 2px solid #6366f1 !important;
  background: var(--surface) !important;
  color: #6366f1 !important;
}
.filter-toggle-btn.active:hover {
  background: rgba(99, 102, 241, 0.05) !important;
}
.filter-toggle-btn .filter-badge {
  position: absolute;
  top: -6px;
  right: -6px;
}

.favorites-toggle-btn {
  white-space: nowrap;
  position: relative;
}
.favorites-toggle-btn.active {
  background: #f59e0b;
  color: white;
}
.favorites-toggle-btn.active:hover {
  background: #d97706;
}

.filter-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #ef4444;
  color: white;
  font-size: 11px;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  line-height: 1;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.filter-search {
  flex: 1;
  min-width: 0;
}

.filter-row-bottom .select-wrapper,
.filter-row-bottom .form-group {
  flex: 1 1 200px;
  max-width: 100%;
  min-width: 150px;
}
.filter-row-bottom .btn {
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .filter-bar {
    padding: 0;
  }
  .filter-row-main {
    flex-wrap: nowrap;
    gap: 0.375rem;
  }
  .filter-row-main .filter-toggle-btn {
    flex-shrink: 0;
    min-width: 44px;
    height: 44px;
  }
  .filter-row-main .filter-search {
    flex: 1;
    min-width: 0;
  }
  .filter-row-main .view-toggle {
    flex-shrink: 0;
  }
  .filter-row-main .view-toggle .btn {
    min-width: 44px;
    padding: 0.625rem;
  }
  .filter-row-main .view-toggle .btn svg {
    width: 20px;
    height: 20px;
  }
  .filter-row-bottom {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.5rem;
  }
  .filter-row-bottom .select-wrapper,
  .filter-row-bottom .form-group {
    min-width: 0;
  }
}
@media (max-width: 480px) {
  .filter-form {
    gap: 0.5rem;
  }
  .filter-row.filter-row-bottom {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.375rem;
  }
  .filter-row.filter-row-bottom .btn {
    grid-column: unset;
    justify-self: unset;
    width: 100%;
  }
  .filter-form.collapsed .filter-row-bottom {
    display: none;
  }
  .filter-row-bottom .select-wrapper,
  .filter-row-bottom .btn,
  .filter-row-bottom .form-group,
  .filter-row-bottom input {
    width: 100%;
    max-width: unset;
  }
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #6366f1;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  transition: opacity 0.2s;
}
.back-link:hover {
  opacity: 0.7;
}

.header-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 1.5rem;
  margin-top: 1.5rem;
}
@media (max-width: 1024px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

.detail-main {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.description-text {
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  text-align: left;
  word-break: break-word;
  overflow-wrap: break-word;
}

.empty-message {
  color: var(--text-secondary);
  font-style: italic;
  text-align: center;
  padding: 2rem 1rem;
}

.time-entries-list .time-entry-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.time-entries-list .time-entry-item:last-child {
  border-bottom: none;
}
.time-entries-list .time-entry-item .entry-info {
  flex: 1;
}
.time-entries-list .time-entry-item .entry-info .entry-title {
  font-weight: 500;
  margin-bottom: 0.25rem;
}
.time-entries-list .time-entry-item .entry-info .entry-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.time-entries-list .time-entry-item .entry-info .entry-meta .icon {
  width: 14px;
  height: 14px;
  margin-right: 0.25rem;
}
.time-entries-list .time-entry-item .entry-values {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  font-size: 0.875rem;
}
.time-entries-list .time-entry-item .entry-values .entry-hours {
  color: var(--text-secondary);
}
.time-entries-list .time-entry-item .entry-values .entry-cost {
  font-weight: 500;
}

@media (max-width: 768px) {
  .time-entries-list .time-entry-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .time-entries-list .time-entry-item .entry-values {
    flex-direction: row;
    gap: 0.75rem;
  }
}
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.info-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.info-item.full-width {
  grid-column: 1/-1;
}

.info-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 120px;
  flex-shrink: 0;
}
.info-label .icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--primary);
}

.info-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  word-break: break-word;
  overflow-wrap: break-word;
  line-height: 1.4;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #6366f1;
  color: white;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background 0.2s;
}
.user-avatar.avatar-mine {
  background: #10b981;
}

.user-name {
  font-weight: 600;
}

.object-info {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.compact-body {
  padding: 0.75rem 1.5rem !important;
}

.compact-empty {
  margin: 0 !important;
  padding: 0.5rem 0 !important;
}

.object-link {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--background);
  border: 2px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
}
.object-link:hover {
  border-color: #6366f1;
  background: var(--surface);
  transform: translateX(4px);
}
.object-link.compact-link {
  padding: 0.75rem 1rem;
  gap: 0.375rem;
}
.object-link.compact-link:hover {
  transform: translateX(2px);
}

.object-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
}
.compact-link .object-name {
  font-size: 1rem;
  font-weight: 600;
}

.object-type {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 600;
  width: fit-content;
}

.object-type-badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.object-location {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}
.object-location svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.object-location-text {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--text-secondary);
  font-size: 0.8125rem;
}
.object-location-text svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.check-items-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.check-item-execute {
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s;
}
.check-item-execute.has-error {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.05);
}
@media (max-width: 768px) {
  .check-item-execute {
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
  }
}

.check-item-number {
  flex-shrink: 0;
  width: 2rem;
}
.check-item-number .item-index {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.875rem;
}

.check-item-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.check-item-label strong {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.check-item-label .required-indicator {
  color: #ef4444;
  margin-left: 0.25rem;
  font-size: 1.125rem;
}
.check-item-label .item-description {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.check-item-input .boolean-options {
  display: flex;
  gap: 1.5rem;
}
.check-item-input .radio-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9375rem;
}
.check-item-input .radio-label input[type=radio] {
  width: 1.125rem;
  height: 1.125rem;
  cursor: pointer;
}
.check-item-input .radio-label:hover {
  color: #6366f1;
}
.check-item-input .measurement-input {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.check-item-input .measurement-input input[type=number] {
  max-width: 200px;
}
.check-item-input .measurement-input input[type=number].invalid {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.05);
}
.check-item-input .measurement-input .unit {
  font-weight: 600;
  color: var(--text-secondary);
}
.check-item-input .measurement-input .range-info {
  width: 100%;
}
.check-item-input .measurement-input .range-info small {
  color: var(--text-secondary);
  font-size: 0.8125rem;
}
.check-item-input .validation-error {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #ef4444;
  font-size: 0.875rem;
  margin-top: 0.5rem;
}
.check-item-input .validation-error svg {
  width: 16px;
  height: 16px;
}

.checklist-item {
  cursor: grab;
  transition: all 0.2s;
}
.checklist-item:active {
  cursor: grabbing;
}
.checklist-item.dragging {
  opacity: 0.5;
  transform: scale(0.95);
}
.checklist-item .drag-handle {
  cursor: grab;
  color: var(--text-secondary);
  padding: 0.25rem;
  margin-right: 0.5rem;
  transition: color 0.2s;
}
.checklist-item .drag-handle:hover {
  color: #6366f1;
}
.checklist-item .drag-handle:active {
  cursor: grabbing;
}

.checklist-item-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.checklist-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.checklist-item-info strong {
  color: var(--text);
  font-size: 0.9375rem;
}

.checklist-progress {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.25rem;
}
.checklist-progress .progress-text {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}
.checklist-progress .progress-text .text-success {
  color: #10b981;
  font-weight: 600;
}
.checklist-progress .progress-bar-container {
  background: var(--border);
  border-radius: 3px;
  height: 6px;
  overflow: hidden;
}
.checklist-progress .progress-bar {
  height: 100%;
  background: #6366f1;
  border-radius: 3px;
  transition: width 0.3s ease;
}
.checklist-progress .progress-bar.progress-complete {
  background: #10b981;
}

.checklist-item-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.checklist-items {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.checklists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}
@media (max-width: 1024px) {
  .checklists-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
  }
}
@media (max-width: 768px) {
  .checklists-grid {
    grid-template-columns: 1fr;
  }
}

.checklist-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
}
.checklist-card.draggable {
  cursor: grab;
}
.checklist-card.draggable:hover {
  border-color: #6366f1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.checklist-card.draggable:active {
  cursor: grabbing;
}
.checklist-card.checklist-completed {
  background: rgba(16, 185, 129, 0.05);
  border-color: rgba(16, 185, 129, 0.2);
}
.checklist-card .drag-handle {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  color: var(--text-secondary);
  cursor: grab;
  padding: 0.25rem;
  opacity: 0;
  transition: opacity 0.2s;
}
.checklist-card .drag-handle:hover {
  color: #6366f1;
}
.checklist-card .drag-handle:active {
  cursor: grabbing;
}
.checklist-card:hover .drag-handle {
  opacity: 1;
}

.checklist-card-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-left: 1.5rem;
}
.checklist-card-header h3.checklist-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  text-align: left;
  word-break: break-word;
  overflow-wrap: break-word;
}
.checklist-card-header .badge-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.checklist-progress-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.checklist-progress-section .progress-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.checklist-progress-section .progress-stats .stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.125rem;
  text-align: center;
}
.checklist-progress-section .progress-stats .stat-item .stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.checklist-progress-section .progress-stats .stat-item .stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  word-break: break-word;
  overflow-wrap: break-word;
}
.checklist-progress-section .progress-bar-container {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.checklist-progress-section .progress-bar-container .progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #6366f1 0%, rgb(114.6, 117.3, 242.4) 100%);
  border-radius: 4px;
  transition: width 0.3s ease;
}
.checklist-progress-section .progress-bar-container .progress-bar.progress-active {
  background: linear-gradient(90deg, #6366f1 0%, rgb(122.4, 124.95, 243.1) 100%);
}
.checklist-progress-section .progress-bar-container .progress-bar.progress-complete {
  background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
}

.checklist-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
}
.checklist-card-actions .btn {
  flex: 1;
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}
@media (max-width: 768px) {
  .card-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

.entity-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  min-width: 0;
  overflow: hidden;
}
.entity-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: var(--border-hover, var(--border));
}
.entity-card.is-favorite {
  border-color: #6366f1;
  background: rgba(60, 22, 249, 0.05);
}
.entity-card.inactive {
  opacity: 0.6;
}
.entity-card .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.entity-card .card-body .card-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.entity-card .card-body .card-field .field-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.entity-card .card-body .card-field .field-value {
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.4;
}
.entity-card .card-body .card-field .field-value.tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.entity-card .card-body .card-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
@media (max-width: 768px) {
  .entity-card .card-body .card-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}
.entity-card .card-body .card-row.card-row-compact {
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 0.5rem;
}
@media (max-width: 768px) {
  .entity-card .card-body .card-row.card-row-compact {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
}
.entity-card .card-body .card-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.entity-card .card-body .meta-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  min-width: 0;
  overflow: hidden;
}
.entity-card .card-body .meta-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.entity-card .card-body .meta-item span,
.entity-card .card-body .meta-item a {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.entity-card .card-body .text-muted {
  color: var(--text-secondary);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.entity-card .card-body .date-item {
  max-width: 100px;
}
@media (max-width: 768px) {
  .entity-card .card-body .date-item {
    max-width: 80px;
  }
}
.entity-card .card-body .date-item .date-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.8125rem;
}
.entity-card .card-body .task-meta .date-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70px;
  display: inline-block;
}
@media (max-width: 768px) {
  .entity-card .card-body .task-meta .date-text {
    max-width: 60px;
    font-size: 0.75rem;
  }
}
.entity-card .metadata-value {
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}
.entity-card .metadata-value.long-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}
@media (max-width: 768px) {
  .entity-card .metadata-value.long-text {
    max-width: 150px;
  }
}
.entity-card .metadata-value .card-description {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.4;
  margin-bottom: 0.75rem;
}
.entity-card .metadata-value .card-assignment {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.entity-card .metadata-value .card-assignment .assignment-item {
  display: flex;
  align-items: center;
}
.entity-card .metadata-value .card-assignment .user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.entity-card .metadata-value .card-assignment .user-info .user-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #6366f1;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  transition: background 0.2s;
}
.entity-card .metadata-value .card-assignment .user-info .user-avatar.avatar-mine {
  background: #10b981;
}
.entity-card .metadata-value .card-assignment .user-info .user-name {
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--text);
}
.entity-card .metadata-value .card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.entity-card .metadata-value .card-tags.card-tags-bottom {
  margin-top: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.entity-card .metadata-value .card-tags.card-tags-bottom .tags-left {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.entity-card .metadata-value .card-tags.card-tags-bottom .tags-right {
  display: flex;
  justify-content: flex-end;
}
.entity-card .metadata-value .card-tags.card-tags-bottom .tags-right .team-badge {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.75rem;
  color: #6366f1;
}
.entity-card .metadata-value .card-tags .badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
}
.entity-card .metadata-value .card-tags .badge svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}
.entity-card .metadata-value .meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.entity-card .metadata-value .card-text {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.5;
  margin: 0;
}
.entity-card .metadata-value .card-text.truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.entity-card .card-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}
@media (max-width: 768px) {
  .entity-card {
    padding: 1rem;
    border-radius: 10px;
  }
  .entity-card .card-header .card-title {
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

.loading-state,
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--text-secondary);
  text-align: center;
  padding: 2rem;
}
.loading-state p,
.empty-state p {
  margin: 0.25rem 0;
}
.loading-state .help-text,
.empty-state .help-text {
  font-size: 0.875rem;
  opacity: 0.8;
}
.loading-state .empty-icon,
.empty-state .empty-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  opacity: 0.5;
}

tr.inactive,
.inactive {
  opacity: 0.6;
}
tr.inactive .user-name,
tr.inactive .team-name,
tr.inactive .object-name,
.inactive .user-name,
.inactive .team-name,
.inactive .object-name {
  text-decoration: line-through;
}

@media (max-width: 768px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .checklist-item-header {
    flex-wrap: wrap;
  }
  .checklist-item-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .checklist-item-actions .btn {
    flex: 1;
    min-width: 0;
  }
}
@media (max-width: 1024px) {
  .detail-grid {
    gap: 1rem;
  }
  .checklist-item-info strong {
    font-size: 0.875rem;
  }
}
.favorite-pulse {
  animation: favoritePulse 0.3s ease-out;
}

@keyframes favoritePulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}
.document-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.document-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s;
  text-align: left;
  word-break: break-all;
  overflow-wrap: break-word;
}
.document-item:hover {
  border-color: #6366f1;
  background: var(--surface);
  transform: translateX(4px);
}
.document-item span {
  flex: 1;
  font-size: 0.875rem;
  word-break: break-all;
}
.document-item .external-icon {
  flex-shrink: 0;
  color: var(--text-secondary);
}

.team-badge {
  display: inline-block;
  padding: 0.5rem 0.875rem;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-weight: 600;
  color: #6366f1;
}

.badge-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.tag-badge {
  background: var(--tag-color, #6366f1);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.tag-badge.badge-xs {
  padding: 0.125rem 0.5rem;
  font-size: 0.6875rem;
}
.tag-badge.badge-sm {
  padding: 0.2rem 0.625rem;
  font-size: 0.7rem;
}

.table-container {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 768px) {
  .table-container {
    margin: -1rem;
    padding: 1rem;
  }
}

.table-view {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-view table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.table-view table th,
.table-view table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table-view table th:first-child,
.table-view table td:first-child {
  padding-left: 1.5rem;
}
.table-view table th:last-child,
.table-view table td:last-child {
  padding-right: 1.5rem;
}
.table-view table th {
  background: var(--background);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: sticky;
  top: 0;
  z-index: 10;
}
.table-view table tr {
  transition: background-color 0.2s;
}
.table-view table tr:hover {
  background: var(--background);
}
.table-view table tr:last-child td {
  border-bottom: none;
}
@media (max-width: 768px) {
  .table-view table th,
  .table-view table td {
    padding: 0.5rem 0.75rem;
  }
  .table-view table th:first-child,
  .table-view table td:first-child {
    padding-left: 1rem;
  }
  .table-view table th:last-child,
  .table-view table td:last-child {
    padding-right: 1rem;
  }
}
