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

body {
  font-family: 'Courier New', monospace;
  font-size: 13px;
}

/* ── Pivot table ─────────────────────────────────────────────────────── */

#pivot-table {
  border-collapse: collapse;
  font-family: 'Courier New', monospace;
  font-size: 14px;
}

#pivot-table th,
#pivot-table td {
  padding: 6px 18px;
  text-align: center;
  border: 1px solid #d0d0d0;
  white-space: nowrap;
}

/* Grey zone: non-interactive header/corner cells */
.grey { background: #f2f2f2; color: #555; }

/* Thick separators */
.sep-r { border-right: 3px solid #888 !important; }
.sep-b { border-bottom: 3px solid #888 !important; }

/* Clickable column headers */
.col-hdr {
  cursor: pointer;
  user-select: none;
  font-weight: bold;
}
.col-hdr:hover { background: #ffebee !important; }
.col-hdr.selected { background: #c62828 !important; color: white !important; }

/* Clickable row headers */
.row-hdr {
  cursor: pointer;
  user-select: none;
  font-weight: bold;
}
.row-hdr:hover { background: #ffebee !important; }
.row-hdr.selected { background: #c62828 !important; color: white !important; }

/* Highlighted column cells */
.in-col { background: #ffcdd2 !important; }

/* Highlighted row cells */
.in-row { background: #ffcdd2 !important; }

/* Pivot cell (intersection of selected column and row) */
.pivot { background: #fff176 !important; font-weight: bold; }

/* Clickable B-matrix cells */
.b-cell { cursor: pointer; }
.b-cell:hover { background: #fff8e1 !important; }

/* Bounds row */
.bounds-row td,
.bounds-row th {
  border-top: 1px dashed #bbb;
  border-left: none;
  border-right: none;
  border-bottom: none;
  color: #888;
  font-style: italic;
  padding-top: 5px;
}
.bounds-row .sep-r { border-right: 3px solid #aaa !important; }

/* ── Sidebar inputs ───────────────────────────────────────────────────── */

.sidebar-section {
  background: #f8f9fa;
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 12px;
}

/* ── Status messages ─────────────────────────────────────────────────── */

.msg-success {
  background: #e8f5e9;
  border-left: 4px solid #4caf50;
  padding: 8px 12px;
  border-radius: 3px;
  margin: 8px 0;
}

.msg-error {
  background: #ffebee;
  border-left: 4px solid #f44336;
  padding: 8px 12px;
  border-radius: 3px;
  margin: 8px 0;
}

.msg-info {
  background: #e3f2fd;
  border-left: 4px solid #2196f3;
  padding: 8px 12px;
  border-radius: 3px;
  margin: 8px 0;
}

/* ── History entries ─────────────────────────────────────────────────── */

.history-entry {
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  margin-bottom: 8px;
  overflow: hidden;
}

.history-entry summary {
  padding: 8px 12px;
  cursor: pointer;
  background: #f5f5f5;
  font-weight: bold;
  user-select: none;
}

.history-entry summary:hover { background: #eeeeee; }

.history-entry .entry-body {
  padding: 10px 12px;
  overflow-x: auto;
}

/* ── Editor table ─────────────────────────────────────────────────────── */

#editor-table td,
#editor-table th {
  padding: 4px 10px;
  text-align: center;
  border: 1px solid #d0d0d0;
}

#editor-table input:focus {
  outline: 2px solid #1976d2;
  border-radius: 2px;
}

#editor-2d-table td,
#editor-2d-table th {
  padding: 4px 10px;
  text-align: center;
  border: 1px solid #d0d0d0;
}

#editor-2d-table input:focus {
  outline: 2px solid #1976d2;
  border-radius: 2px;
}
