/* ==========================================================================
   PlanMeasure Pro - Table & Measurement Data Styles
   ========================================================================== */

.bottom-panel {
  height: var(--table-height);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 35;
  position: relative;
  transition: height var(--transition-fast);
}

.bottom-panel.collapsed {
  height: 38px !important;
}

/* Drag handle to resize bottom table (Mouse & Touch Friendly) */
.panel-resize-handle {
  position: absolute;
  top: -7px;
  left: 0;
  right: 0;
  height: 14px;
  cursor: ns-resize;
  z-index: 40;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.panel-resize-handle::after {
  content: '';
  width: 42px;
  height: 4px;
  border-radius: 2px;
  background: var(--border-default);
  transition: background var(--transition-fast);
}

.panel-resize-handle:hover, .panel-resize-handle:active {
  background: var(--accent-cyan-glow);
}

.panel-resize-handle:hover::after, .panel-resize-handle:active::after {
  background: var(--accent-cyan);
}

/* Panel Header & Controls Bar */
.table-toolbar {
  height: 44px;
  padding: 0 1rem;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 1rem;
}

.table-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.table-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.table-stats-badge {
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  background: var(--bg-elevated);
  border-radius: 12px;
  color: var(--accent-emerald);
  font-weight: 600;
  font-family: var(--font-mono);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.table-filters {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.table-search-input {
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  background: var(--bg-primary);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  font-size: 0.78rem;
  width: 160px;
}

.table-search-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
  width: 200px;
  transition: width var(--transition-fast);
}

.table-filter-select {
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  background: var(--bg-primary);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  font-size: 0.78rem;
  cursor: pointer;
}

/* Table Body & Scroll View */
.table-scroll-container {
  flex: 1;
  overflow: auto;
  position: relative;
}

.measure-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.8rem;
  white-space: nowrap;
}

.measure-table thead {
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  z-index: 10;
  border-bottom: 2px solid var(--border-default);
}

.measure-table th {
  padding: 0.55rem 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  user-select: none;
}

.measure-table td {
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
}

.measure-table tbody tr {
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.measure-table tbody tr:hover {
  background-color: var(--bg-hover);
}

.measure-table tbody tr.selected {
  background-color: rgba(6, 182, 212, 0.15) !important;
  outline: 1px solid var(--accent-cyan);
}

.measure-table tbody tr.row-done {
  opacity: 0.65;
}

.measure-table tbody tr.row-done td.col-name {
  text-decoration: line-through;
}

/* Table Column Widths & Typography */
.col-status { width: 44px; text-align: center; }
.col-id { width: 50px; font-family: var(--font-mono); color: var(--text-muted); }
.col-ref { width: 140px; }
.col-name { font-weight: 600; }
.col-type { width: 175px; }

/* Inline Table Type Selector */
.table-type-select {
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.74rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  max-width: 165px;
  transition: border-color var(--transition-fast);
}

.table-type-select:hover,
.table-type-select:focus {
  border-color: var(--accent-cyan);
  background: var(--bg-hover);
}

.table-type-select option,
.table-filter-select option {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

@media (pointer: coarse) {
  .status-checkbox {
    width: 22px;
    height: 22px;
  }
  .measure-table td {
    padding: 0.6rem 0.75rem;
  }
  .table-type-select,
  .table-filter-select,
  .table-search-input {
    min-height: 36px;
    font-size: 0.82rem;
  }
}

/* Status Checkbox for Baustelle */
.status-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent-emerald);
}

/* Room / Bezugspunkt Badge */
.room-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: var(--bg-tertiary);
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
}

.room-color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(100, 116, 139, 0.6); /* macht helle Farben (Weiß) sichtbar */
  flex-shrink: 0;
}

/* Type Pill */
.type-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.72rem;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

/* Table Empty State */
.table-empty {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}
