/* Sidspecifik CSS för /app/tables.html (bordslayout). Delar tokens/knappar/dialog
   med theme.css — här ligger bara det som är unikt för layout-redigeraren. */

.layout-panel {
  display: flex;
  flex-direction: column;
  padding: var(--space-5) var(--space-4) var(--space-4);
}

.layout-heading { padding-bottom: var(--space-3); }

.layout-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding-bottom: var(--space-3);
}

.layout-hint {
  margin: 0;
  color: var(--text-tertiary);
  font-size: 10px;
}

.layout-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

/* ---- Desktop/iPad: visuell planritning ---- */
.floor-canvas-wrap {
  height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
}

.floor-canvas {
  position: relative;
  width: 100%;
  min-height: 560px;
  height: 100%;
  background-image:
    linear-gradient(rgba(22, 22, 22, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 22, 22, .05) 1px, transparent 1px);
  background-size: 32px 32px;
}

.table-chip {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 76px;
  height: 76px;
  padding: 4px;
  border: 2px solid transparent;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .08);
  cursor: grab;
  touch-action: none;
  user-select: none;
  transform: translate(-50%, -50%);
  transition: box-shadow .15s ease, border-color .15s ease;
}

.table-chip:active { cursor: grabbing; }
.table-chip.dragging { z-index: 5; box-shadow: 0 10px 24px rgba(0, 0, 0, .18); }
.table-chip.selected,
.table-chip:focus-visible { border-color: var(--brand-end); outline: none; }
.table-chip.shape-round { border-radius: 50%; }
.table-chip.shape-square { border-radius: var(--radius-md); }
.table-chip.size-small { width: 64px; height: 64px; }
.table-chip.size-medium { width: 82px; height: 82px; }
.table-chip.size-large { width: 102px; height: 102px; }

.table-chip .chip-number { font-size: 17px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.table-chip .chip-capacity { display: flex; align-items: center; gap: 2px; color: var(--text-secondary); font-size: 9px; font-weight: 600; }
.table-chip .chip-capacity .material-symbols-rounded { font-size: 11px; }

.chip-pills,
.row-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px;
  max-width: 100%;
}

.chip-pills .pill-dot,
.row-pills .pill-dot {
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  display: inline-grid;
  place-items: center;
  border-radius: 7px;
  color: var(--text-secondary);
  background: var(--surface-hover);
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
}

.empty-canvas-hint {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text-tertiary);
  font-size: 11px;
  text-align: center;
  padding: var(--space-6);
}

/* ---- Mobil: enkel lista ---- */
.table-list-mobile { display: none; height: 100%; overflow-y: auto; padding: 2px; }

.table-list-row {
  display: grid;
  grid-template-columns: 40px 1fr auto auto;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: 12px 10px;
  border: 0;
  border-bottom: 1px solid rgba(22, 22, 22, .06);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.table-list-row:last-child { border-bottom: 0; }
.table-list-row:hover { background: var(--surface-subtle); }

.table-list-row .row-number {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: #343432;
  font-size: 14px;
  font-weight: 700;
}

.table-list-row .row-main { display: grid; gap: 2px; }
.table-list-row .row-room { color: var(--text-tertiary); font-size: 9px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.table-list-row .row-capacity { display: flex; align-items: center; gap: 4px; color: var(--text-secondary); font-size: 11px; font-weight: 600; }
.table-list-row .row-capacity .material-symbols-rounded { font-size: 15px; }
.table-list-row > .material-symbols-rounded { color: var(--text-tertiary); font-size: 18px; }

/* ---- Dialogens fält som bara gäller visuell placering (form, storlek) ---- */
.field-desktop-only { display: grid; }

.connection-pills { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 2px; }

.connection-pill {
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 16px;
  color: var(--text-secondary);
  background: var(--surface-subtle);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition: background .16s ease, color .16s ease;
}

.connection-pill:hover { background: var(--surface-hover); }
.connection-pill.active { color: #fff; background: var(--brand-gradient); }
.connection-pill:disabled { opacity: .4; cursor: not-allowed; }
.connection-empty { color: var(--text-tertiary); font-size: 11px; }

@media (max-width: 767px) {
  .floor-canvas-wrap { display: none; }
  .table-list-mobile { display: block; }
  .field-desktop-only { display: none; }
  .layout-hint { display: none; }
}

@media (max-width: 1100px) {
  .layout-panel { padding: var(--space-4) var(--space-3) var(--space-3); }
}
